skip to Main Content

MongoDB Aggregation – Fetch data from ObjectId subarray

I have these collections: author [ { _id: "63c242130b17d5516e0cb499", author_name:'Vyom', book_ids:["63c242330b17d5516e0cb49a","63c242410b17d5516e0cb49b"] } ] book [ { _id:"63c242330b17d5516e0cb49a", author_id:'63c242130b17d5516e0cb499', book_name:'True Love', genere:'horror' }, { _id:"63c242410b17d5516e0cb49b", author_id:'63c242130b17d5516e0cb499', book_name:'Monster Strike', genere:'romance' }, ] I want to fetch details of books in author collection…

VIEW QUESTION

MongoDB aggregate to get stats

I've done this sometime last year, but now I really can't recall and can't find any helpful resources. I want to get the statistics of my collection based on types. This is my data object { "_id": { "$oid": "63bfc374378c59a5328f229e"…

VIEW QUESTION
Back To Top
Search