Category "mongodb"

how to download a file saved in gridFS using nodeJS

I need to download a resume from GridFS, below is the code ive written to do it, but this seems to not give me a physical file for download, this is used to rea

How to stream data from mongodb in Structured Streaming?

Is it possible to use spark structured streaming to read data from mongo db with a readStream ? For standard use of structured streaming, I usually do so: va

Connection Not established in Mocha to MongoDB Atlas

When starting my application it connects to MongoDB Atlas as logged, however, when running mocha tests it does not even try to connect to the DB. here is my ser

zsh: command not found: mongo

I'm following the official instructions found here (on Mac OS Big Sur): https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/ When attempting to run

Java Mongodb regex query

I have to run this query in Java db.Users.find({"name": /^ind/i}) My Java code is Document findQuery = new Document(); findQuery.append("name", Pattern.co

Mongoose won't update new field after updating schema declaration

I just noticed that when i update my schema definition and add a field, for instance "name: String" and then try to use People.update( { _id: user_id }, { $se

MongoDB Compass Visually Insert Sub-Document

I'm using MongoDB Compass to visually build my collection. In the highlighted section, I don't see a "Document" type to insert a sub-Document. Am I doing it th

how can i make BCryptPasswordEncoder() work in spring because in my application can't find that classes

how can i make BCryptPasswordEncoder() work in spring because in my application can't find that class about that and the message is not matching for dependenci

Create a user in MongoDb using powershell

I'm using MongoDb v3.0.3 and want to create a user in a database with admin privileges using powershell. I hook into the C# driver but I don't get very far: $p

MongoserverError: bad auth: authentication failed problem

I correctly use the username and password in the url of vs code for my server side but in the cmd i find the error of mongodb authentication fail. why this is h

Is there any way to implement pagination in spring webflux and spring data reactive

I'm trying to understand reactive part of spring 5. I have created simple rest endpoint for finding all entities using spring web-flux and spring data reactive

mocha wait for db connection before running tests

Basically to run the tests, I need the database connection to MongoDb to be ready. The database manager has a connect method to get a connection and a get metho

How to use User.findOne({ userID: searchUserID } correctly ??? (currently not getting return value)

I am currently trying to implement an update / put functionality in my node.js-project and having issues I have absolutely no clue, where that comes from. (also

Convert string to ISODate in MongoDB

I am new to MongoDB and I am stuck on the String to Date conversion. In the db the date item is stored in String type as "date":"2015-06-16T17:50:30.081Z" I wa

formidable - SyntaxError: Unexpected token - in JSON at position 0 when sending POST request

I am building the backend for creating blog posts for my web application while following a tutorial. The technologies I am using are MongoDB, express.js, formid

How do I use Spring Mongo to group two fields and get a array of one fields based on the other?

Let me give a example here: Two entries in the collection Author: { "name" : "Joe" "Book" : "A" }, { "name" : "Joe" "Book" : "B" } Now, if I use the aggrega

mongodb how to get the correct uri

I've inherited node.js, mongodb system. The original dev used a mlab db on his own account, I was asked to copy to a different db. When I tried to create a ml

String field value length in mongoDB

The data type of the field is String. I would like to fetch the data where character length of field name is greater than 40. I tried these queries but returni

Readiness probe failes because mongosh --eval freezes

I installed the latest bitnami/mongodb chart for a standalone architecture. The Readiness and Liveness-probes are failing because the statement mongosh --eval "

spring mongodb - How to provide match condition to check for empty array using spring data mongodb api?

how to perform below operation (it is the actual mongo query) using MatchOperation in Spring data mongodb ? $match: { "docs": { $ne: [] } } here docs is an a