Category "mongodb"

Err:data and salt arguments required

connectde with datadase (mongodatabase) and chik if email == new email! and used bcrypt to do securty password. exports.createNewUser = (username, email, passwo

MongoDB Laravel works local but not on host

Would anyone know how to fix this I can't find any method that works online. My mongodb does work local but not on host. I'm using laravel with the following:

pymongo - "dnspython" module must be installed to use mongodb+srv:// URIs

I am trying to connect MongoDB from Atlas. My mongo uri is: mongodb+srv://abc:[email protected]/admin?retryWrites=True My pymongo version is 3.6.1 I h

Mongodb insert null date

Mail Schema: var mail = new mongoose.Schema({ globalId: {type: String, index: true, unique: true}, from: {type: String, required: true}, beginDate:

Renaming collection in MongoDB

I am trying to rename a collection in MongoDB. I accidently wrote db.currentName.renameCollection() but I should have wrote db.currentName.renameCollection(newN

MongoDB - Get latest non-null field value from documents with timestamp

In the MongoDB collection I'm querying, each document represents some data for a parcel at a specific time. Every time I receive an update for a parcel, some fi

findOneAndUpdate is not a function of mongoose

I know this question has been answered before but I can't seem to implement the changes into what im working with. I'm trying to create a daily command that rew

MongoDB : How to update a new field value according to existing field value in each document?

I am working on a project and it currently goes through each document to edit the field and lags a lot. { "Name" : "Susie" , "This Semester" : 10 , "Last Semest

Get trending groups using mongodb aggregation

I have two collections, Group and GroupChat. A group has a chatroom respectively. // group.model { name: string, desc: string } // group.chat.model { group:

Subdocument not being saved in its own collection - Mongoose

I found this on the documentation for mongoose: Subdocuments have save and validate middleware just like top-level documents. Calling save() on the parent docu

MongoDB query inside an array

I want to use this mongoDB collection: [ { "_id": { "$oid": "627c4eb87e7c2b8ba510ac4c" }, "Contact": [ { "name": "ABC",

Trying to find "magic combinations" in MongoDB

I have two MongoDB collections in a database named "records". Here's a sample document from the first collection: course_completions { "_id" : NumberInt(1

Delete object from inner schema in mongoose?

How do I delete object from inner schema in mongoose? I try to delete comments from the Holiday Schema, this is the holiday schema: const holidaySchema = new mo

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): AssertionError [ERR_ASSERTION]

I have the following setup in Visual Studio Code for nodejs project: Model: genre.js const Joi = require('joi'); const mongoose = require('mongoose'); const

.mongo' is not recognized as an internal or external command, operable program or batch file

I have installed mongo db. Then when i tried to execute .mongo or mongo in command prompt. It's showing this error: .mongo' is not recognized as an internal

Failed to introspect annotated methods on class org.springframework.data.mongodb.core.SimpleMongoDbFactory

I was getting error: Failed to introspect annotated methods on class org.springframework.data.mongodb.core.SimpleMongoDbFactory. Here is the full stacktrace: 0

Increment value in update query mongoDB

I am trying to add two values in a mongoose function. This the function im using: Equipa.findOne({ '_id': req.params.equipaID }, function (error, equipa) {

Find documents in mongoDB collection by coordinates via haversine formula

I have this structure in my collection { "categorie" : "Introduction", "quart" : "jour", "pdq" : 23, "x" : 302375.197993, "y" : 5046522.116

Can Mongo Bulk Operations like insertMany Partially Fail?

After scouring the documentation and posts online, there is one thing I have never been clear about with Mongo. When you are attempting to write documents in bu

MongoDb Java- deeper polymorph tree

I have the following polymorphic structure for objects I want to store in MongoDb: InventoryItem (abstract) / \