I want to convert ObjectID (Mongodb) to String in JavaScript. When I get a Object form MongoDB. it like as a object has: timestamp, second, inc, machine. I can't convert to string....
I have a below collection  [   {     "Array1": [       {         "Array2": [           {             "name": "6666",             "Array3": [               { "_id": 128938120, "nest": "samsun...
Is there any way we can query and get location data using mongodb geospatial query that matches the following criteria?   Getting all locations that are part of intersection between two boxes or in general two polygons.   For example below can we get...
Suppose we have a collection of raw data:  { "person": "David, age 102"} { "person": "Max, age 8" }   and we'd like to transform that collection to:  { "age": 102 } { "age": 8 }   using only mongo(d...
I have a multiple collections , I used the separate collection & foreign key approach , and I want to join this collections to build a nested collections. this is my schemas of collections:  const SurveySchema = new Schema({ _id:{ type: Schema.Ob...
This is my collection:   {         "_id" : 10926400,         "votes": 131,         "author": "Jesse",         "comments" : [                 {                         "id" : 1,                         &...
I have a JS object norm which I want to use inside mongo aggregation pipeline, like this:    var norm = {      1: 1,      2: 1.16,     3: 1.413,     4: 1.622,     5: 1.6,     6: 1.753,     7: 3.001,     8: 2.818,     9: 3.291,     10: 2.824,     11:...
I have such schema:  mongoose.model "Ticket", {   title: String   body: String   likes: Number   comments: [{     body: String     upvotes: Number     downvotes: Number   }] }   My code to query  q = @model.findOne {"comments._id": oi...
I want to join collection. before, I used only lookup, so that I could get separated field that is joined. but I need to get result similar mysql join. I noticed there is $lookup and $mergeObjects for this action but not working well.  user collectio...
If I have Player documents of the form  {name: String, score: Int}   and I have Group documents, where groups represent lists of players  {groupName: String, players: [ObjectID]}   Players can belong to multiple groups.  I want to do an aggregation o...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.