Question: I’m reading a Json file into a JObject myParams with this code. This works well What I want is then to encode the information and save it back into another file. This code reads a file, encodes it and ...

Question: I have a slice of structs that I want to write to a BSON file for doing a mongoimport. This a rough idea of what I’m doing (using gopkg.in/mgo.v2/bson): This runs and generates the file, but it’s not formatted ...

Question: In my MongoDB doc, I have updated field of type string In the pipeline, I’m consuming that field … Everything seems to be in order if I have values in the collection document but if pipeline steps into the ...

Question: I have one extended json string. Trying to convert above json string to document in order to insert it into MongoDB. For this I am using org.bson.Document.Document.parse(json_string) constructor. But the document I am getting after parsing, doesn’t preserve the ...

Question: I want to retrieve the exact object from an array of nested objects using a mongoose query. I have tried some queries using $elemMatch but not getting the exact object I am targeting rather I get the array of ...

Question: Given the following document data in collection called ‘blah’… What I want to get is all of the coding elements where system is ABC for all parents, and an array of codes like so. If I use db.getCollection('blah').find({"coding.system": "ABC"}) ...