Questions tagged as 'mongoose'

0
answers

Mongodb: Find every x days

[Mongodb] Staff, I have the following situation: I have several documents saved with the following structure: { ..., repetir : "semanal", a_cada: 2 } In short, I have a cron running daily and I need to fetch the documents according to the c...
asked by 21.12.2016 / 00:08
0
answers

Use the same Schema inside a daughter key with Mongoose

I'm working with NodeJS, MongoDB and Mongoose where I'm creating an access permissions system that works with infinite sub-levels. The permissions have the same Schema: //app/models/PermissaoModel.js const mongoose = require('mongoose'); cons...
asked by 17.01.2017 / 17:58
0
answers

How to model a friend system with MongoDB?

I am creating a small social network and I need to create the share of friendships. I have two ideas: A Friendship collection containing the sender, recipient, and response fields and make a populate with mongoose. Put a Friend o...
asked by 19.12.2016 / 19:58
1
answer

Help with mongoose

Not understanding what happened: ready = function() { groups = mongoose.model('groups', schemas.group); groups.find({}, function(err, docs){ for(i in docs){ console.log(docs[i].name); } return docs; }); } console.log(r...
asked by 19.03.2016 / 05:28
0
answers

Mean Stack Running the first project

Good afternoon guys, I'm trying to run the mean stack on my machine (Ubuntu 14.04, 64bit), I followed the site step by step and everything seemed to go well when I started up the cam in ternimal everything works fine, I'm going to access the url...
asked by 07.05.2016 / 17:20
1
answer

Relationship in MongoDB

Good afternoon, I'm in need of help from someone who has experience with MongoDB to get me out of a doubt. I'm studying about MongoDB and I came across the following problem: I have 2 Collections: Customers and Users Each client has its...
asked by 14.03.2016 / 18:46
0
answers

Doubt with FindOne in AngularJS using MongoJS error when searching

Hello, I'm trying to do a search on the bank with this code using the mongojs findOne, follow code: app.get('/detalhesContato/:id', function(req, res){ var id = req.params.id; console.log(id); db.contatos.findOne({_id: mongojs.Obj...
asked by 05.02.2016 / 21:09
0
answers

mongoose syntax error

I'm trying to create an application using express.js and mongodb, when I try to run the server this syntax error appears. The error that appears refers to a document with only zeros (Ex: 0000 0000 0000 0000 ), I am a noob in the matter....
asked by 26.03.2015 / 23:14
1
answer

Last record

I need to know how to get the last record stored in the mongo. I'm doing a search, comparing two IDS, I need to return only the last record. I have the following variables: client.name client.cpf client.endereço I'm doing the sear...
asked by 24.06.2015 / 16:18
1
answer

Using model.find () with LIKE in mongoose

I have a function here to search MongoDB using mongoose, but I would like it to find Brazil when I search for bra, Bra, Sil, sil, etc. I looked at the documentation and followed the example but it did not work, it does not return anything. Here...
asked by 03.01.2019 / 19:40