I'm trying to synchronise two functions I run in my app. First one checks the count of the documents I save to MongoDB every time block (e.g. every 10 seconds) in the real time:  var getVolume = function(timeBlock, cb) {     var triggerTime = Dat...
Here is simple node route in which calling an asynchronous api.   What needed is to return data after the looping. But It is returning blank object.  try {   const array = ["brunch", "lunch", "crunch"]   const data = {}   arra...
I have a collection that contains documents with a date attribute like so:  {    title: "whatever",    created: ISODate("2013-05-27T03:36:50Z") }   I would like to select records that were created on a certain day.  I was hoping I cou...
My documents in the orders collection has _client key, which is an ObjectId references to another entity in another collection. The collection could be organization and could be users - I mean - it's variable collection. I want to tell Mongo to l...
I got a collection with documents such as those:  {     "_id": 0,     "pictures": [         {             "path": "/path/to/first/picture.jpg",             "web": "true"         },         {...
I have a mongodb collection called cases and inside cases I have an array of cases per company object.  So the structure is:    Inside each case I want to use the createddate (which is a string) and endDate (also string) and convert it to a mongodb d...
For the following dataset example:  lists  { _id: 1, included_lists: [ 2 ], items: [ "i1" ]} { _id: 2, included_lists: [], items: [ "i2", "i3" ]}   items  { _id: "i1", details: [{}, {}, {}]} { _id: "i2", detail...
So I'm doing a search with mongodb / mongoose. I have a post document and this post document has a comments property which consists of comment IDS. The goal of this search is to gather all the user's posts where a comment was added today.   I...
I have a mongodb collection data as per below;I want to group Speciality,Code and Age fields based on EmployeedID( i.e 0001).  { "_id" : ObjectId("54d0512191a4da7736e9db43"), "EmployeeID" : "0001", "Speciality"...
Here is my MongoDB collection schema:  company: String model: String tags: [String]   I need to aggregate it so I get the following output:  [{   "_id": {     "company": "Lenovo",     "model": "T400"   },   ...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.