skip to Main Content

How to find specific object from array in MongoDB

Suppose I have this MongoDB document: { "_id": { "$oid": "628f739398580cae9c21b44f" }, "place":"Amsterdam", "events": [ { "eventName": "Event one", "eventText": "Event", "eventDate": "010101" "host":"Bob" }, { "eventName": "E2", "eventText": "e2", "eventDate": "020202" "host":"John" } ] } { "_id": { "$oid":…

VIEW QUESTION

Need help to MongoDB aggregate $group state

I have a collection of 1000 documents like this: { "_id" : ObjectId("628b63d66a5951db6bb79905"), "index" : 0, "name" : "Aurelia Gonzales", "isActive" : false, "registered" : ISODate("2015-02-11T04:22:39.000+0000"), "age" : 41, "gender" : "female", "eyeColor" : "green", "favoriteFruit" : "banana", "company" :…

VIEW QUESTION

Having issue with aggregation in MongoDB

I'm using MongoDb with Node.js. And I'm having trouble with aggregation.This is the Example of data in Collection in Database: { "name": "abcdef", "address": ghijk, "reli":"A", "prov:"a" , } { "name": "xyz", "address": "vwz", "reli":"B", "prov:"b" , } { "name":…

VIEW QUESTION
Back To Top
Search