Questions tagged as 'mongoose'

1
answer

Collections - mongodb

I have a collection called suspeitosSchema and another call acoesSchema . suspectsSchema: const suspeitosSchema = new mongoose.Schema({ sexo: { type: String }, etnia: { type: String }, cumprimentoCabelo: { type: String...
asked by 01.12.2017 / 19:58
1
answer

Wrong time at Mongodb

When I put in MongoDB schema : created: { type: Date, default: Date.now } The time is 3 hours too long. How can I fix this?     
asked by 01.03.2015 / 17:09
3
answers

Search MongoDB Array

I have these two documents in the mongo: /* 0 */ { "_id" : ObjectId("54f395ef7a5a5ea37af77398"), "HISTORICO" : [], "MOTIVO" : "", "RP_CANCELAMENTO" : "", "DATA_CANCELAMENTO" : null, "RP_FINALIZACAO" : "", "DATA_FINALIZACAO" : null, "STATUS_CH...
asked by 02.03.2015 / 00:53
1
answer

Change field unique collection mongodb

Good morning, I have a collection in mongodb with a unique:true field. I would like to change this field to false. If I change the code and delete the entire collection it works, but if I make the change in the code and do not dele...
asked by 27.02.2015 / 12:38
1
answer

Field "__v" in all documents in a collection

All my documents in a MongoDB database have a __v field, what does it mean? > db.speeds.find({}).limit(2).pretty() { "_id" : ObjectId("586826f700890738a5e8cb3d"), "remoteId" : 1, "first" : ObjectId("586826f700890738a5e8cb...
asked by 31.12.2016 / 23:03
2
answers

Block saving of repeated data

How do I check the controller, if an email already exists in the mongoose database and thus, does the lock save it again?     
asked by 10.07.2015 / 22:07
1
answer

Update in mongoDB is deleting the rest of the document

I have a Structured Collection like this: { "_id": i43h21n5lk2354, "createdAt" : ISODate("2018-08-19T16:56:31.555Z"), "services" : { "facebook" : { .... name: "Michael Jackson" .......
asked by 19.08.2018 / 19:07
1
answer

MongoDB Model

Hello! I'm starting to use MongoDB with Mongoose in NodeJS and I'm encountering a strange behavior when creating mesus Models in MongoDB. Example: mongoose.connect('mongodb://localhost/db_teste'); const PersonSchema = new Schema({ name: {...
asked by 07.05.2017 / 00:46
1
answer

Inserting mongodb documents

I have the following document (Schema): var CandidatoSchema = new Schema ({ id_login: Schema.Types.ObjectId, nome: String, cpf: String, dataNascimento: Date, sexo: String, estadoCivil: String, endereco: { en...
asked by 02.04.2016 / 05:18
1
answer

Edit an element within an object, within an array, with Mongoose

I need a help! I'm new to Node.JS and I decided to "create a system" to put into practice what I already know and create challenges to encourage my learning! I did a beginner workshop (with Jean Carlo Suissa) that gave me a good foundation, but...
asked by 04.03.2015 / 02:21