Category "mongodb"

MongoDb can't use types in jest - declares ... locally, but it is not exported

I use the mongodb library in TypeScript for a few functions (e.g. lambda functions but that should not matter). The imports look like that: import { ObjectId, D

Update indexes mongodb using Spring

Does someone know what Spring application properties need to be specified so that the index is overwritten (if already been created) with new parameters. For ex

Adding an image while using mongoose Schema

How can I add an image to my mongodb when using the mongoose.schema in JS? const chequeSchema = new schema({ chequeImageUri: { type: Image, req

MongoDB how to update an object property in nested array

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

No environment variables with Next.js TypeScript Custom server

I am currently building a next.js app for a course at uni. I want to run a script when the development server starts that performs some API calls to update the

mongodb command very slow

I have 3 documents like this: { _id: ObjectId("..."), _details: { _session: ObjectId("example_1"), }, { _id: ObjectId("..."), _details: { _session: Obje

Aggregate Pipeline to exclude collections from db.watch() MongoDB

I am using MongoDB's changeStreams to watch for changes in my database. My database has 17 collections. I'd like to watch every collection for changes except fo

Update a value in a nested field?

user :["id": 1, userObj:[{"bookid": 1, "library":"Oxford", "taken":true}, {"bookid": 2, "library":"Cambridge", "taken":true}]] I would like to update the value

Using C# LINQ with MongoDB Find

I am only about 3 days into using MongoDb and C# driver so be gentle. ;-) I have a MongoDB query working with AsQueryable. I would like to use the collection.Fi

meteor How to use upsert | Exception while simulating the effect of invoking ” TypeError: Cannot read properties of undefined (reading ‘_id’) react.js

I’m having trouble with upsert with meteor.js. I could update questions finely with the below codes but I won’t be able to insert new data. file in

how can i get the specific info about a user

i'm working on a web app in which a user can create an address when logged in, how can i get the current logged in user address which was created by the user th

MongoDB Connect train routes

I have a collection of train routes that contain some "connecting" data. For example I have a source and destination field that looks like this { "source": {

How to join three (multipe) collections with $lookup in mongodb?

How to join three (multipe) collections with $lookup in mongodb? Hi I am looking to join data from three collection users collection: [ { _id:0, name:"abc", pho

Problems with same query in mongoid rails db but different parameters

I’m using mongoid gem ’mongoid’, ’~> 7.2.4’ (mongoDB 3.6) with rails (5) and I have a database with customer collections and bi

Mongo Restore fails to restore time series collection with the same name

I have a timeseries collection in mongodb liveSamples collection, I'm trying to dump some documents from this collection and then restore it later with mongores

findOneAndUpdate. Select array of messages, select message object and update likes array inside it

I use mongoose findOneAndUpdate method, but could't achieve the result. I always get the same object back. No errors. Here's my code. User object: { "_id" :

Serverless deploy from M1 MacBook Pro causes invalid ELF header error

I have a serverless REST api connecting to MongoDB atlas. When making changes and running sls deploy everything deploys as normal. But when I query the DB from

How to return a query in a MongoDB database by Date, using Mongoose schemes?

I've trying to create an endpoint in my API which return the youngest and oldest person from my database using mongodb e mongoose. My database looks like that:

Return the data of a model directly instead of a dictionary Express.js and Mongoose

Probably the title isn't very clear and is a bit confusing, and to be honest, I do not really know how to ask this question since I'm new to JavaScript and Mong

React checkbox data from mongodb

I try check if checkbox is checked in mongodb or not So for isClosed my value in db is true And its working so far my checkbox is checked bcs its true in db. Bu