Category "mongodb"

Mongodb aggregate group by then conditional sum, or, filter, push, using c#

Can someone please help to convert this query to C# .NET core? db.getCollection("accout").aggregate().match({ $or: [{"clientnum1": "xxxx"},{ "clientnum2": ""}],

Spring boot mongodb QuerydslPredicateExecutor ClassNotFoundException: com.querydsl.mongodb.document.MongodbDocumentSerializer

I'm trying to use QuerydslPredicateExecutor. Here is my repository interface: public interface ProductsRepository extends MongoRepository<Product, String

MongoDB get sum of fields which I have modified in the project pipeline

I want to calculate avgAmount as the sum 3 fields = [balanceLoaded + operatorDueAmount - walletUsage]. But these fields can either be zero or themselves (balanc

Mongoose Schema for Groups (a number of users in one group)

One aspect of my website is that people can join groups according to a specific code provided to them, for example- when we play 'Kahoot' or 'Psych', we have to

Incrementing a "PlayerID" with a MongoDB Atlas Trigger

I need to have a playerID that is separate from _id and increments with each new entry into my users collection. I have tried to follow this tutorial with no lu

I have trying to update my quantity in mongodb server Its showing Null. How Can I solve this?

##I have trying to update my quantity in mongodb server Its showing Null. How Can I solve this?## ``` const handleSubmit = event =>{ const inputQuantity

Why I am getting "Not Implemented Error: Database objects do not implement truth value testing or bool()." while running makemigration cmd in django

I am trying to connect Django with MongoDB using Djongo. I have changed the Database parameter but I am getting this error Not Implemented Error: Database objec

Mongodb $ operator for nested documents [duplicate]

there is a wfs collection as follows: { _id:'1', transitions: [ { _id:'11', checkLists: [ { _id:'111',

Mongoose query always returns empty array

Im trying to make a greater than query but it always returns an empty array. const productSchema = require("./productsSchema"); const getProductsGreaterThan

mongodb query $in operator, fetch by ObjectId in Array

All my documents have a structure like this: { operational: {availableFleet: [Objectid('5bad3f452641a1186d21b5f8'), ...]} } So every document has an operati

C# and MongoDB - Returning values from an object

I'm hoping someone can help: I have MongoDB collection for a User which has an Array called Reports which holds objects with IDs. I can retrieve the IDs but I'm

How can i add React loading spinner when item is fetching from database?

Here is, my code. i want to add a spinner when data is loading then after finish loading display the data. {/* product section */} <section className="c

How to find documents based on the result of a function mongoose

So I have two schemas user and driver they both have latitude and longitude attributes. At some point I want to query the database for nearby drivers, I will be

Why is my mongo query using the $in operator producting an error?

The following query is erroring out: const pastOrders = await Order.find( {user: userId}, {status: {$in: ["delivered", "refunded"]}} ).popul

How to add attribute to the result of mongoose query before res.status(200).send(result);

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

Mongoose.connect is not connecting to local db

I'm building a simple MERN blogging app with a local MongoDB. Everything was working fine until yesterday. I literally changed nothing at all and now I can't co

Remove Embedded Documents in an Array in MongoDB with mongoose (updateOne - $pull) not work

I have an app with MongoDB (Mongoose) in NodeJs. In a collection I have this type of documents, defined by weeks: { "_id": {"$oid":"617f3f51f883fab2de3e7260"},

mongodb net::ERR_CONNECTION_REFUSED

I have just write post method for inserting data in MongoDB.when submit form for fetch data form frontend that time gets this error List item net::ERR_CONNECTIO

MongooseServerSelectionError: connect ECONNREFUSED ::1:27017 wont get fixed

I've been trying for over 2 hours now trying to figure out what's wrong with this database. I've tried everything. From reinstalling the server, restarting the

MongooseError: Operation `therapists.find()` buffering timed out after 10000ms

I have seen this issue published in a few places however I still don't have a solution. I am using a node server and can connect to my database correctly with a