Category "mongodb"

Document Read and insert with locking/transaction in nodejs with mongodb

In reservation system, only 5 different user can create bookings. If 100 user call booking api at same time than how to handle concurrency with locking. I am us

Querying with mongoose: how to parce a Mongo _id?

I found this similar question to mine, but without explanation Mongoose find query vs $match, I'm trying to do something similar. I manage to filter by today's

Mongoose - array of enum strings

I have a Schema that has a property with the type of array of strings that are predefined. This is what I've tried to do: interests: { type: [String], e

Achieve "all-or-nothing" transaction between Oracle and MongoDB

I have an usecase(migrate data from Oracle to MongoDB via Java app) where I required to implement transaction management to ensure "all-or-nothing" in the datas

Update a local python dictionary using mongo syntax, without mongo

I have a codebase that uses mongo. I want to add a caching layer in between where the persistence code is called and the actual mongo db, primarily so that I ca

TypeError: Cannot read property 'then' of undefined , TypeError: _cb is not a function

my code in github, but I didn't upload the latest version: https://github.com/godzillalogan/markdownblog I use node.js and express.js framework. Database use mo

MongoDB Shell deleteMany() function is not working

I have to delete all the data called owner.login. It means in json data, there are one more Object called owner. So I tried in MongoSH Beta(MongoDB Compasss) an

How can Add two different field which type is ObjectId in same object which refer same schema

const ChatSchema = new mongoose.Schema({ username: { type: String, }, mobile: { type: Number, }, friends: [ { type: mongoose.Schema.

How fix error encoding BSON to MongoDB Compass?

I installed MongoDB Compass, and I get error message “An error occurred while loading navigation: Invalid UTF-8 string in BSON document”. I can&rsqu

Connecting to mongoDB(/mongoose) from a website?

I'm creating a website, and currently for a feature I need it to connect to my mongoDB database, is there any way to do this? As far as I've seen it's not possi

Mongoose Error: "useCreateIndex" is not supported but documentation still has it

This is frustrating. No clues why I got this error while documentation still has it. Please help! My code to connect MongoDB with mongoose. const mongoose = req

Why Google Cloud Run gettings massive container restart / new instance creation?

I've been using Google Cloud Run for a year now and the issue with cloud run containers restarts / new container start is from the beginning. I've hosted Node +

MongoDB throwing "metadata corruption: files file:sizeStorer.wt and file:WiredTigerHS.wt have the same file ID 1"

My initial database was 3.2, and I spent the the time upgrading through every release to get to 4.4.0. Mongodb will no longer start when getting to 4.4.0, throw

Import MongoDB data into Hive Error: Splitter implementation is incompatible

I'm trying to import mongodb data into hive. The jar versions that i have used are ADD JAR /root/HDL/mongo-java-driver-3.4.2.jar; ADD JAR /root/HDL/mongo-hado

laravel get error of Call to a member function prepare() on null

In Laravel I have got this error, while inserting a record in my MongoDB database. Call to a member function prepare() on null namespace App\Http\Controllers;

Trying to call function by using db.eval("functionName()") in mongoDB compass version 4.4 But getting error as TypeError: db.eval is not a function

db.system.js.insertOne({ _id: 'getMachinewiseLogDat', value: function () { return db.Smx_22235_ShiftOEEDaily.aggregate([ { $group: {

I need to apply a 24hour cooldown after use, and add to the token balance on a correct answer (discord.js v13)

Here is the challenge bot slash command: const { SlashCommandBuilder } = require('@discordjs/builders'); const { MessageEmbed, MessageAttachment

How to use MongoAuditting with MongoTemplate?

i'm trying to upsert using MongoTemplate. but auditting does not work.(@CreatedDate, @ModifiedDate fields didn't save) how to enable auditing with MongoTemplate

Property 'create' does not exist on type { new (fileBits: BlobPart[], fileName: string, options?: FilePropertyBag | undefined):File; prototype: File}

I'm trying to create a file-sharing app using Multer, Cloudinary, Typescript, and Mongoose. When I'm trying to save the files uploaded by users and the data lik

How to create nested array inside $group in MongoDB?

After some of the aggregation pipeline stages, my MongoDB Document has the following format: { "key": "A", "status": "To Do", "val": 4 }, {