Questions tagged as 'mongodb'

1
answer

How to edit an attribute in the database?

I am developing an API where I want to edit information or login . I can already get the user information after logging in as you can see in the function: memberinfo apiRoutes.get('/memberinfo', passport.authenticate('jwt', { se...
asked by 29.01.2018 / 19:42
1
answer

Questions about indexes for Boolean fields - MongoDB

I have documents with boolean fields in a Mongo collection. To index these fields, is it better for their values to be Number (0 or 1) or does it make no difference if they are Boolean? I have received some "slow query" alerts in the search by u...
asked by 28.12.2017 / 23:04
1
answer

Update array of objects in MongoDB with Node?

Good evening guys. I'm developing a simple chatbot for testing purposes, but I came across a problem. I have a user, when starting a conversation, a bot is generated, and this bot has an array of messages and responses. I want every time I se...
asked by 26.02.2018 / 23:46
1
answer

Create different indexes for different searches - MongoDB

Hello, At another time I needed to get posts similar to a specific one in the blog I'm developing, and this similarity is governed by the tags used in each post. Using MongoDB, I did this by creating an index on the tags, like this: db.mypo...
asked by 10.08.2017 / 16:26
1
answer

Nested documents

Personal I have a question that I believe is basic to anyone who is starting with nosql and comes from classic relational structures. Well, let's look at a simple example for relational structures: I have the table person with id and pers...
asked by 07.08.2017 / 14:22
1
answer

Compare two object arrays?

I need to compare 2 arrays in Javascript, one that returns from one MongoDB query and the other comes from the email provider. The two comparison criteria are the email ID and the box to which it belongs, and the email will be discarded if th...
asked by 05.09.2017 / 19:08
1
answer

How to adapt a JSON to create a table in pdfMake?

I need to get a JSON that returns from MongoDB and through a forEach generate a table and create a PDF, however I am not able to adapt the JSON to the structure of pdfMake, follows JSON: { "_id" : ObjectId("5978e9f71277a5dae49db945"),...
asked by 27.07.2017 / 16:27
1
answer

import a mongodb tuple

Hello, I'm importing a collection of mongodb documents, I'm importing from a csv file, I'm having trouble importing key pairs: value, mongodb is recognizing everything as string, example: I want the document to be saved on import. "coordinates...
asked by 23.06.2017 / 18:24
1
answer

Change document after post-save middleware in mongoose

I'm working with mongoose.js and I'm going to need to, after saving the document in the database, I get attribute of that document. From what I understood in the mongoose documentation itself, I realized that I could do this using a middleware...
asked by 01.06.2017 / 20:37
1
answer

Creating and changing users and permissions

I have run the mongod with the default configuration, that is, I have not set the path, nor the port, nor enabled the access control . p> C:\Program Files\MongoDB\Server.4\bin>mongod Trying for "more advanced things," I wanted to create...
asked by 18.05.2017 / 00:30