how to create a bson::Document from bson::raw::RawDocument in rust?

Advertisements I’m trying to read from a bson file containing a single bson document (in reality I’d want to read from a byte array passed by the caller). The file was created from a python dict usign the RawBsonDocument class. This is the code used to create the file: import bson from bson.raw_bson import RawBSONDocument… Read More how to create a bson::Document from bson::raw::RawDocument in rust?

how to make a mongo filter search case insensitive in c#

Advertisements I have this query here: var filter = builder.Eq("BuyerDetails.Buyer.Email", request.BuyerEmail) | builder.Eq("BuyerDetails.Buyer.FirstName", request.FirstName) & builder.Eq("BuyerDetails.Buyer.Surname", request.LastName); however the problem is that i am unable anticipate the case of the email, firstname and surname is mongo. if the request is firstName = "STACK" and LastName = "OVERFLOW" and the document in mongo is "firstName =… Read More how to make a mongo filter search case insensitive in c#

Unable to retrieve multiple values from database

Advertisements The following data exists in the database: [ { "_id": { "$oid": "628c787de53612aad30021ab" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030000", "open": "1.12161", "high": "1.12209", "low": "1.12161", "close": "1.12209", "vol": "561", "id": 1 }, { "_id": { "$oid": "628c787de53612aad30021ac" }, "ticker": "EURUSD", "dtyyyymmdd": "20030505", "time": "030100", "open": "1.12206", "high": "1.1225", "low": "1.12206", "close": "1.1225", "vol":… Read More Unable to retrieve multiple values from database

Add array data by name php

Advertisements I’m new to arrays. I’d like to know if you can add data to the array by name. This would be an example of what I want to achieve example: $guitars = [‘names’,[‘Warvick’, ‘Gibson’, ‘Fender’]]; $guitars[names][] = "Ibanez"; echo "<pre>"; var_dump($guitars); echo "</pre>"; result WARNING Use of undefined constant names – assumed ‘names’ (this… Read More Add array data by name php

Display last, 2nd last and 3rd last value from a database and display in a specific order

Advertisements Assume i have the following in my database, db connection established: A user form that has and input enter product with a submit button, which inserts into the database. id and product, with a table named table. Filled with information. Then i select the last id by doing the following: $results = mysqli_query($con, "SELECT… Read More Display last, 2nd last and 3rd last value from a database and display in a specific order

Query nested array from document

Advertisements Given the following document data in collection called ‘blah’… [ { "_id" : ObjectId("60913f55987438922d5f0db6"), "procedureCode" : "code1", "description" : "Description 1", "coding" : [ { "system" : "ABC", "code" : "L111" }, { "system" : "DEFG", "code" : "S222" } ] }, { "_id" : ObjectId("60913f55987438922d5f0dbc"), "procedureCode" : "code2", "description" : "Description 2", "coding"… Read More Query nested array from document