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 have two collection  Collection_foo :  {     cid:'1234',     'foo':'bar',     some 10+ fields... }   Collection_bar :  {     cid:'1234',     'foobar':'barfoo',     some 10+ fields... }   I want to joi...
In my project I would like to calculate monthly precipitation and temperature averages (min/max) for the whole year, similarly to this chart or average views in this app (which is using Forecast.io data).  I have stumbled quite early, however, as I a...
I have to create a tree structured table with some data given in the form of json array.  let us take an example array  array : [ { "continent": "Asia", "country":"India", "population": 100, "GDP":4}, {...
I want to extract the min and max values from all of the properties of the collection:  "data": [     {         "food": 41000,         "drinks": 60,         "toys": 18961,         "candy": 8740     },     {...
Here i have Two arrays,   Usercar = [{             parentId :001             cars:[                    {_id: 1, name: bmw, color: red},                    {_id: 2, name: Ford, color: black},                    {_id: 3, name: Volkswagen, color: black}...
I am new to using MongoDB and I have an issue by selecting all documents having a string value match one field in thair fields of type object.  Here is my document structure:  {     "_id" : ObjectId("5e418404bfa0c42c913b0646"),     &#...
i have very complex query and atleast 6 to 7 collection lookup in single aggregate inside this multiple $project  and $lookup nested $lookup  and $addfield   its taken 5 second in 20 document i want in 1 second   var result = await PostSchema.aggrega...
My targred is to exclude records which are already mateched from previous match aggregation in MongoDb.   In first match I need to fetch records from two countries: United States and Germany.  In second match I need to exclude records from given coun...
I am trying to make an aggregation on users collection and than make a $lookup on another collection usersurveystatuses to find if this user has completed surveys. This works fine but it projects only users who have matching surveys. How can i keep a...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.