返回首页

Questions tagged [mongodb]

MongoDB is a scalable, high-performance, open source, document-oriented NoSQL database. It supports a large number of languages and application development platforms. Questions about server administration can be asked on http://dba.stackexchange.com.

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

SQL Primary Key (ID) Auto start from beginning

I am using a 3rd party pricing API, the data is with start and end date with a price. I have checked that SQL database limits as follows; BIGINT Integer data from -2^63 through 2^63 - 1 INT ...
0
votes
0answers
3 views

MongoDB on Docker for Windows ~ Export/Import Data

I am trying to set up an easy-to-use workflow for people in my company to set up a MongoDB Database on Windows, and enable them to exchange their databases as needed. One impediment here is the need ...
0
votes
0answers
9 views

Users schema with poking other users schema in node.js

I am making an application in which a user can poke other users.Here is the code for the schemas which i thinks about. Here is the first way we can do. const userSchema = new Schema({ name: { type ...
0
votes
0answers
8 views

Can we create custom backend in terraform?

I want to store my terraform.tfstate file in mongodb database. I could see that there is no default option available for mongodb as a backend in terraform. So, can we create a custom backend in ...
-3
votes
0answers
10 views

Recipe Db With Mongo DB Python [closed]

I am very much new to Mongo (no previous knowledge on Db Structure too)and Python environment, My requirement is to create a recipe Db. Once data will be added, where I can fetch recipes with ...
0
votes
2answers
24 views

Spring Boot test API endpoint with unit testing should return 404 instead of 400

I have the following controller on my Spring Boot application, which is connected to a MongoDB: @RestController @RequestMapping("/experts") class ExpertController { @Autowired private ...
2
votes
1answer
15 views

Mongo DB - How to create a dynamic field based on the presence of element in array?

I have a problem in Mongo for which I am not getting any clue to resolve it efficiently. Say I have a 'Course' collection something like this (index is created on the 'studentIds' field): { "...
0
votes
1answer
27 views

Go: How to unit test a piece of code that works with Mongo collections?

I am using the official Mongo driver for Go. My code looks like this (omitted error handling in order to make the example simpler): type DB struct { collection *mongo.Collection } func (db DB) ...
1
vote
0answers
16 views

Two Way Embedding vs. One Way Embedding in MongoDB (Many-To-Many)

I would like to discuss with you, if it makes any sense to use two way embedding instead of one way embedding, when modeling an N:M relationship in MongoDB. Let's say, we have two entities: A Product ...
0
votes
0answers
9 views

How can I make unique validator with 2 properties on Mongoose?

I need make a unique validator with two properties in Mongoose. For example, I have this and work fine: beerSchema.index( { beerType: beerSchema.beerType, description: beerSchema.description }, { ...
1
vote
1answer
19 views

I want to know how to write an update script for Mongo DB

I want to know how to write the mongodb script for updating the field in my db my collection is something like this { _id: 1, name: xyz, answer: [ { type: 'C', from: ...
0
votes
0answers
13 views

How to convert MongoDB\MapReduceResult to array?

I'm using MongoDb php-library in my code. I like how it works. Now, I'm able to get MapReduceResult like so: $map = new MongoDB\BSON\Javascript('function() { emit( { incident: this....
0
votes
1answer
13 views

Cancel MongoDB transaction programatically

I am using MongoDB transactions as the following example shows and I am wondering if there is a way to cancel the updating transaction programmatically in case the following step fails. const ...
0
votes
2answers
14 views

Working on mern Stack Application - Delete Operation

import React from 'react'; import { Button, Table, Modal, Form } from 'react-bootstrap'; import axios from 'axios'; const Company = props => ( <tr> <td>{props.company.companyName}...
0
votes
0answers
13 views

displaying user information after submitting register form using vue

I have a vue application which inserts user information by using the database mongodb atlas. i am storing all the data which is inserted into the db by using json which can be viewed by inputting ...
-1
votes
1answer
46 views

Cannot set headers after they are sent to the

Please I am creating an app with mongoDB and node.js but in my js file ,after I have flashed a message using connect flash and redirecting ,I get the error "Cannot set headers after they are sent to ...
0
votes
0answers
8 views

Build Criteria query for multiple elemMatch

How can I build below aggregation stage using Criteria object (org.springframework.data.mongodb.core.query.Criteria) { "$match": { "attributes": { $elemMatch: { ...
0
votes
0answers
12 views

Marking the N most reset docs by day in MongoDB 4.2

I have a collection of documents with scheme: { _id: ObjectId, userId: ObjectId, marker: string, datetime: Date, etc... } This is a collection of markers (marker) bounded to a user (userId). The ...
0
votes
1answer
16 views

MongoDB generated ObjectID for arrays is descending instead of ascending

I have the following document in a collection in my MongoDB database: "_id":"5e2088563824e72ea5ee7095", "image":"xxx", "questions":[ { "_id":"5e2088563824e72ea5ee70c3", "text":"...
1
vote
0answers
11 views

Document Level Locking In MongoDb 4.2

I want to read 10M documents out of 30M documents in one Thread and I do not want these 10M to get accessed by another thread while rest 20 million should be accessible.
0
votes
3answers
40 views

Laravel eloquent - Eager loading nested relations

I have the following 3 tables: Posts Comments Tags Posts: class Post extends Eloquent { public function comments() { return $this->hasMany(Comment::class,'...
0
votes
0answers
8 views

How to implement registration on site using Java and Mongodb [closed]

I want to make registration on site, but I don't know how implement it.Can you tell me how I can make it or link for information about it? Thank you in advance.
1
vote
1answer
23 views

MongoDb find using dynamic query object

I am new to node js and Mongo Db. I am trying to edit the user details . So for that I displayed the user list with Edit link for each user. When I click on edit link I passed the name of the user ...
0
votes
0answers
11 views

$geoIntersects function on mongoose always returns true

Im trying to check if a latitude and a longitude intersects with my Polygon. And if so, apply a discount on a price. But whatever i do, its always applying the discount even if i used A point from New ...
0
votes
0answers
10 views

Prisma can't deploy with local Mongodb

This is my docker-compose.yml: version: '3' services: prisma: image: prismagraphql/prisma:1.34 restart: always ports: - "4466:4466" environment: PRISMA_CONFIG: | ...
1
vote
1answer
24 views

Store location data in Mongodb document

In my current project , I am storing the location data in the following format in a Mongodb document "location" : { "loc" : { "lng" : -118.15592692, "lat" : 34....
0
votes
1answer
25 views

Login application error with my fullstack vue express app

I'm following a tutorial to create a full-stack register login application with vue.js in the front-end, express in the back-end and mongodb whan I register a new user and login with it's email and ...
0
votes
1answer
24 views

Display all cars older than 5 years

I am new at MongoDB, I have about 5 documents about cars, I need to display all cars older than 5 years. How would I do that? Each document looks similar to this { "Model" :2005, "Make" : "...
-1
votes
0answers
35 views

How to delete child class by child id in Springboot mongo template

Getting error while trying to delete groupusers class by user id in all groups in mongotemplate Spring boot application public class Group { private UUID Id; private List<GroupUsers> ...
1
vote
1answer
23 views

MongoDB filter with aggegation framework

I have a mongoDb document in this format { account_key : "tiziano", notifications : [ { address: "tiziano@myemail.com" , notification_type: ['booking_confirmation','booking_deletion'] },...
-1
votes
0answers
19 views

mongoose - How to automatically get average stats of an user from all his past matches

I am currently planning each mongoose model for a PUG system for an fps game. I would store the mongoose id's for each match that the player participated in an array "matches". The player should be ...
1
vote
1answer
30 views

Mongoose/MongoDB Get mostly viewed articles grouped within a day

I am trying to clone a Reddit-like community board API using MongoDB + Mongoose on Node.js. My sample JSON data looks like below: { "genre": "free", "...
1
vote
1answer
14 views

Use Regex in mongodb aggregate

Have a collection with values _id:ObjectId('......') ton_id :ObjectId('abcd') value:qwejc+iejtns/@ date:2019-12-13T07:09:40.075+00:00 _id:ObjectId('......') ton_id :ObjectId('abcd') value:asdf+kine ...
0
votes
1answer
18 views

Using map to change dates from string [duplicate]

I have previously asked a question about converting string to dates - Convert Date to String in nested array in mongodb - and got a great and working answer. The only issue is that when a date is a ...
0
votes
2answers
34 views

How to find documents that contain a certain number of Embedded/Nested Documents in an array

I was wondering if it is possible to select documents based on the number of nested documents in an array? For example could my query select the URL of any document that contains less than or equal ...
3
votes
1answer
24 views

Java, Springboot, MongoDB extend SimpleMongoRepository (2020)

I've found many problems with this here in Stackoverflow. But they are all in few years back. Hoping to find an updated solution. I'm Extending SimpleMongoRepository in my own class to add some ...
0
votes
1answer
12 views

Android studio get data from html and filter only some value to show on textView

I have data from mongoDB and I can show on textView like this so I want to show some data on textView. Ex. Show only temperature: 24 humid: 50 mycode package com.example.okhttp3; import ...
0
votes
1answer
19 views

MongoDb - Do i need an index on a second field when using deleteOne

I have a simple collection events { "_id" : ObjectId("5e2a9bb9dcb646448f9409b3"), "year" : 2020, "employee_id" : "5e1afe5ab7bad92b20365476", "event" : ["Holidays"], "total" : 21, ...
0
votes
0answers
9 views

Why @TextIndexed in Spring data mongo doesn't have background property?

We can see the property background for other indexes @indexed, @CompoundIndex but not in @TextIndexed. Whats is the reason and is there any workaround to make textIndexed created in background.
0
votes
2answers
30 views

exports return null before executing mongodb save when i call it from another controller?

I have to call one controller function from another, but other function is not returning a proper value. I called a function from one controller in line 'a',line 'b' is another controller.but inside ...
0
votes
0answers
13 views

Tableau sql MongoDB nested object

I am trying to fetch nested object parmeter through Tableau Custom SQL . My Collection is in this format // collection: disbursementProjectionPlanned { "openingMembersCount" : 2002, "...
0
votes
1answer
16 views

How to remove redundant data with skip and limit in mongodb

When we fetch data from db with skip and limit then it's very high chance that data may be redundant. Let me explain you with an example suppose you are fetching those student records which belongs ...
1
vote
1answer
35 views

nullpointerexception for mongodb insert

I have the following piece of code which is supposed to insert a document into a MongoDB Collection as shown below (Note I have the @Slf4j annotation above the class which should let me use log): ...
1
vote
1answer
25 views

Expected “[” or AggregationStage but “{” found.: MongoDB aggregation doesn't let me use $toLower inside a $eq

I wrote a MongoDB pipeline that has this code in it: { $eq: [ { "$toLower": "HELLO" }, "hello" ] } And here's a screenshot of it in Mongo Compass I am ...
0
votes
1answer
27 views

How to return an array from Mongodb collection using findone

I'm using find one to find a specific user_id and return an array data which is in the specific document. Below is my document structure package main import ( "context" // manage multiple ...
0
votes
1answer
30 views

Error connecting to mongodb with mongo-spark-connector

I am new to spark/mongodb and I am trying to use mongo-spark-connector to connect to mongo from pyspark following the instructions here. I start pyspark with the command `pyspark \ --conf 'spark....
0
votes
0answers
11 views

For @DBRef is it require to fetch parent entity in order to save the child entity using Mongo db?

User.java @Id private String id; @Transient private String organizationId; @DBRef private Organization org; Organization.java @Id private String id; private String name; etc... UserController.java ...
0
votes
1answer
10 views

How to do the performance evaluation of findOneAndUpdate() after indexing in mongo

I could see .explain("executionStats") to evaluate the performance of find() queries in Mongo. But .explain is not working on findOneAndUpdate(). Is there a way to see how much the indexing is helping ...
0
votes
0answers
4 views

try to connect aws documentDB (mongodb) in my local code node js. Can someone help on this?

[nodemon] restarting due to changes... [nodemon] starting `node app.js` (node:2908) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a ...
0
votes
1answer
32 views

Cannot connect to Mongo 3.6 replicaset using Node.js

I have a mongo 3.6 replicaset setup on machine with IP 192.168.1.175 with below command, $ sudo mongod --port 27017 --replSet "rs0" --bind_ip_all --dbpath ~/data/db/rs1 & $ sudo mongod --port ...

返回首页
杏彩计划 杏彩官网 杏彩APP 杏彩走势图 杏彩下载 杏彩官方 杏彩网站 杏彩怎么玩 杏彩官方 杏彩靠谱吗 杏彩代理 杏彩骗局 杏彩投注 杏彩倍率 杏彩开奖 杏彩漏洞