Questions tagged as 'mongodb'

1
answer

Can I create js files that execute mongodb commands?

The issue is that I want to create some scripts that receive parameters to later perform operations like CRUD. For example, having an application developed in x language, when wanting to make an operation to the DB, the request is sent to the...
asked by 24.11.2016 / 19:10
1
answer

Display a random word, from a JSON object stored in MongoDB, every 5 seconds

I have an Ajax request that extracts data from a JSON object created in MongoDB and shows them to me on the screen. But what I'm stuck in is showing a word, from that array, randomly every 5 seconds. I have made the setInterval and it works, but...
asked by 20.11.2018 / 13:12
1
answer

Cast to ObjectId failed for value \ "private \" at path \ "_id \" for model \ "Product \"

Hi, I'm doing an API Rest with Nodejs and MongoDB and I have the following problem: { "message": "Error al realizar la petición: CastError: Cast to ObjectId failed for value \"private\" at path \"_id\" for model \"Product\""} I do not unde...
asked by 18.08.2018 / 11:44
1
answer

problems with accessing properties of an object in a request graphQl

Hi, I'm working on a reactive project with apollographQL and I'm having problems accessing the properties of the object that comes to me from the graphQl server with the mongodb database. Declare a test object in the same component and if I can...
asked by 13.08.2018 / 20:04
1
answer

Convert timestamp to dd / mm / yyyy and add Timezone to Dataframe Panda

I am loading information into a DataFrame of the Python Panda module, where I have a timestamp type record, that information is brought from MongoDb cursor = collection.find( { "sono" : str(sono), "time" : { "$gt" : int(start) }, "time" :{"$l...
asked by 16.08.2018 / 21:36
2
answers

Mongoose query with conditional

I would like to make a query of all the files that have as id_folder 'CJJ3' or 'NQPM', however in the query I can only put a parameter, is there any way to do this? The code I have is the following File.find({id_folder: 'CJJ3'}, '_id, name')....
asked by 08.06.2018 / 07:20
1
answer

Update a field in Mongoose if the new value is not null?

having a Schema like this: const FarmSchema = new Schema({ name: { type: String, required: true }, extension: { extension: { type: Number, min: 1, max: 1000, required: true }, measure: {...
asked by 05.05.2018 / 21:31
1
answer

How do I set an array as a parameter in JavaScript? [closed]

I've been trying a new function to my program, this program has the purpose of making it easier to search for elements within an array, all these elements are unique, one way to find them and deliver them is by a rank, giving two parameters in t...
asked by 25.04.2018 / 21:25
1
answer

How to create a user that does not have the possibility to delete the Mongo DB?

I have created this type of user but with it I can do everything When doing:    what I do. use database db.logout() -----------> para asegurarme que no este logeado con ningun usuario db.auth("restrictedUser", "password") -----------...
asked by 17.04.2018 / 02:06
1
answer

How to instantiate an object to create a document in mongodb

Hi, I'm new to this, I understand that to create the model of a scheme, it's like that = > var Movie = mongoose.model('Movie', movieSchema); var movie = new Movie(); //instanciamos mi objeto user(Documents are instances of our model...
asked by 10.04.2018 / 13:29