I'm doing a couple of $match's and $unwind's and end up with a collection of documents looking like this: { _id:249776348, StartGameTime:1615789789, team:0, win
My query let findEvents = await eventModel.aggregate([ { $match: { participants: { $eq: event.userId }, eventStatus: { $
I am learning Django with MongoDb and have a collection to search into. Here is a sample document in the collection: { "_id": { "$oid": "62615907568ddfc
I have 3 objects like this {"_id":{"$oid":"625f0e73b1d7269de9ebdaeb"}, "Type":"scalar", "Temperature":22.79, "Vibration":{"A-P2P":{"X":85},"Z2P":{"X":43},"Crest
I'm working on social media platform and I need to fetch posts for newsfeed with mongodb search query. currently I'm using dynamic index on my post collection,
const score_schema = mongoose.Schema( { tester_id: { type: mongoose.Schema.Types.ObjectId, ref: "user", required: true, }, test_
Okay, the title is a bit too verbose and complicated but I have no idea how to put it any better. So here's what I have ModelA ModelB that has reference to Mode
I have a collection of documents representing values at specific dates. Some of those dates don't have a value (the field can be missing or set to null). I'd li
I've recently came across this behaviour that I cannot explain. $geowithin return documents outside the polygon queried. To illustrate my problem, I've made a m
I have 2 mongodb documents shop and customer shop documents are like below { id: 1, zipcodes:[ '12345', '11111', ] } { id:2, zipcodes:[ '45678', ]
I appreciate any help in such case. Collection in MongoDB (now only 4 documents for demonstration purpose): { "_id" : ObjectId("62684847e9594c65cbaa5d85
I have a document with format like this: { "f1": "v1", "f2": { "id": 1, "sub": "subv", "updatedAt": 123 } } I have an another source that
I want to calculate avgAmount as the sum 3 fields = [balanceLoaded + operatorDueAmount - walletUsage]. But these fields can either be zero or themselves (balanc
I have data and need to group by two fields and in response display unique filed along with the count on this field. Sample data: [ { "categoryCode":"c
I am hoping someone can help me as I am new to Mongo DB or point me to a work around, I have a property within a Mongo DB document which is of type object, but
I want to unwind some data, but preserve the parent. I am getting the whole flattened objects, but missing the first one. I want to keep that one. How can I do
I would like to count different hu for a shipment. So I write this query but how I can count different hu group by shipment ? my query : db.eventstranslated.agg
How to bring age group base data from a collection in MongoDB i.e how many people are 0-18, 19-24, 25-34, 35+ [ { "_id": ObjectId("608be7c608c7de2367c8963
So I have a list of posts data that looks like this: [ {user: 'Bob', country: 'USA'} {user: 'Kim', country: 'Mexico'} {user: 'Darren', country: 'Mexico'}
I have a list of commentDocument collection in MongoDB where each has the following structure: { "commentName": "test comment", "outputs": { "ex