Mongodb – Optimize mongo $in query
I've a mongo collection having around 550,000 documents. Document has an array field path on which i have a below query in my java code. This field is indexed. Problem is ids in below query can go up to 6000…
I've a mongo collection having around 550,000 documents. Document has an array field path on which i have a below query in my java code. This field is indexed. Problem is ids in below query can go up to 6000…
I have the following record: id: 119, customfields: Array (2) 0: Object value: "Mr" type: "salutation" 1: Object value: "Google" type: "company" I need to update this document so that I get: id: 119, salutation: "Mr", company: "Google" Important is:…
compound index: { A: 1, B: 1, C: 1 } query: col.aggregate([ { $match: { B: "ssome_value", C: "some_other_value, } } ]) The query does not involve A, so the compound index is not used. I can do this to…
I have Millions of documents in the mongodb collection. I want to group the documents based on minute and hour interval. I created the index for timestamp. I tried below mentioned query, but it's took too much time or timeout.…
when i run my ruby script which insert a multiple Json array inside a multiple documents, occur an issue: "MONGO::Error::MaxBSONSize : The document exceeds maximum allows BSONB object after serialization". How can i solve this problem please? i had no…
I have mongo documents like below, want to perform aggregation to find the errorcodes count for each unique contacts. { "_id": { "$oid": "" }, "campId": "61baef7817cd8ff66518", //camp1 "contactId": "61aa6fbf77490b0007714273", // contact 1 "title": "Happy Holidays!", "communicationType": "EMAIL", "contactedOnTime": {…
compound index { A: 1, B: 1 } In this query, the compound index is not used: db.user.aggregate([ { $match: { B: { $gt: 100 } } }, { $sort: { A: 1 } }, { $limit: 1000 } ])…
How can I write a mongo query to filter today's record with time when I have date and time in string in json object in mongo. My Json Object is { "_id": "" "data_id": 3227, "series_id": 240, "date_wise": "17 Sep…
I am having issues with projecting some fields with mongodb $project my colection has the following datas [{num:"SI-0101",mob:6289141515},...] and my $project query [{ $project: { "Id No.": "$num", "Mobile No.": "$mob" // note on that ., i need it in…
I would like to all documents which the last event of category Temperatures is technicalFailure even if there are other events after this one. To give more context, the query is the result of a http request with query parameters.…