there is a document schema that has an array field called "updatedFields" which contains some fields names that you will find in "oldDocument" and "newDocument"
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 a Collection allRecords as {'name':'tom', 'subjects':'Physics'} {'name':'jerry', 'subjects':'Maths'} I have one json file is testData.json as {names:",t
I appreciate any help in such case. Collection in MongoDB (now only 4 documents for demonstration purpose): { "_id" : ObjectId("62684847e9594c65cbaa5d85
I have the following structure in my MongoDb where I have a topic object inside of a topics array. Within the topic object, I have a messages array. What I am t
I have 3 documents like this: { _id: ObjectId("..."), _details: { _session: ObjectId("example_1"), }, { _id: ObjectId("..."), _details: { _session: Obje
user :["id": 1, userObj:[{"bookid": 1, "library":"Oxford", "taken":true}, {"bookid": 2, "library":"Cambridge", "taken":true}]] I would like to update the value
I have a document with format like this: { "f1": "v1", "f2": { "id": 1, "sub": "subv", "updatedAt": 123 } } I have an another source that
How to convert a SQL query to mongodb query? Please write a mongodb query - this is my query in SQL: UPDATE user SET expireIn = DATEADD(DAY, 2, expireIn) WHE
We are working on a project to get data from mongoDB. We have created repository class as below @Repository public interface CustomerRepository extends MongoRep
I am trying to build a CRUD API that query a mongodb. I want to add another attribute (temperature) to the query result before sending it back to the client. Pa
We have a requirement to insert to the sub array when sub array contains some value, but I get an error when using push with arrayFilter: fail to run update: w
I can use the following for exact matches on loosely typed data in MongoDB: var mongoClient = new MongoClient(con); IMongoDatabase mongoDatabase = mongoClient.G
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 have working on my final year college project On MERN stack. my problem is mentioned bellow please help me. const Organization = mongoose.Schema({ name: {
I have a set of circles, defined by points (centers) and a varying radius around it (green, black). I want to query if a given point (red) is contained any of t
I am using MongoDB\Driver\Manager my query is shown below. $globalSearchValue = 'Test'; $mongo = new MongoDB\Driver\Manager("mongodb://localhost:27017"); $b
I'm trying to send query to my Mongo database depending on a variable producted in my R code. Unfortunately, Mongo query needs double quotes and the function "p
If Youtube uses MongoDB as their database, then how would they store the who liked which videos information? Option 1: Store it in the Videos collection with a
My collection has array "name" with objects inside. I need to remove only those objects inside array where "name.x" is blank. "name": [ { "name.x": [