Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

Sails-mongo allows connecting to from using the ORM api.

400 questions
1
vote
0 answers

Sails application fails to connect localhost mongo db

My sails application not able to connect to locally running mongo db instance local.js is like below module.exports.connections = { sailsMongoDBServer: { adapter: 'sails-mongo', host: '127.0.0.1', port: 27017, …
Raj N
  • 249
  • 1
  • 18
1
vote
0 answers

Sails min, max, minLength, maxLength for number and string types gives userError

I am using waterline v0.13.5 package with expressjs. I get an user error { userError: The attribute 'str' on the 'action' model contains invalid properties. The property 'minLength' isn't a recognized property. when trying to use min, max (with…
Gary
  • 2,293
  • 2
  • 25
  • 47
1
vote
1 answer

SailsJS 1.0 : Error in .create() for a model in Mongo with One Way Association to a model stored in MySQL

I have a Users model stored in MongoDb and a UserTypes model stored in MySQL. When I try to create a new User: Users.create({name: "Shivam", userType: 1}) I get following error: { AdapterError: Unexpected error from database adapter: Invalid…
1
vote
1 answer

How to save createdAt updatedAt as Date type instead of String type with Sailsjs 1.0 and mongodb

Sails 1.x saves createdAt and updatedAt as string instead of Date type with mongodb. the problem is that i have aggregation pipes with $add (adding days, months, secs, etc...) with the createdAt and updatedAt fields and Mongodb throws error that…
1
vote
1 answer

A hook (`orm`) failed to load! for Mongodb

Anyone can help?? error: A hook (orm) failed to load! error: Could not tear down the ORM hook. Error details: Error: Consistency violation: Attempting to tear down a datastore (default) which is not currently registered with this adapter. This is…
Gabriel
  • 11
  • 3
1
vote
0 answers

How to Display Table data From from specific index Location

I want to Display Table from specific index location. My source code was displaying all the values contained in the database. Is there any way to display from a specific location. import React,{Component} from 'react'; import…
Tarun
  • 15
  • 6
1
vote
0 answers

Sails-mongo automatic failover

I'm using sails-mongo in my nodejs application, and my config looks like this: mongoDb: { adapter: 'sails-mongo', url: 'mongodb://prod_user:prod_password@router-1-incloud:16888,router-2-incloud:16888/db_name', auto_reconnect: true, poolSize:…
akhabaiev
  • 449
  • 1
  • 4
  • 10
1
vote
1 answer

Sails 1.0 - sails-disk for dev/test and sails-mongo for production

In Sails 1.0, I'm trying to use sails-mongo for dev and production and sails-disk for test. Before version 1.0 I could do this, but now I receive an error: error: Error: In model 'user', primary key 'id' must have either 'required' or…
Makah
  • 4,435
  • 3
  • 47
  • 68
1
vote
3 answers

mongoDB and sails aggregate dont work with nodejs

I'm using mongodb and sails framework, Production.find({}) is working normally but Production.aggregate([]) is returning an error Production.aggregate() is not a function module.exports = { list : function(req,res) { …
Lucas Breitembach
  • 1,515
  • 11
  • 15
1
vote
0 answers

skipper gridfs image upload

I'm having a problem in sails js image uploading using skipper gridfs. My connection is fine but however when I upload an image it logs an error to my terminal MongoError: error processing query: ns=admin.uploads.chunksTree: $and files_id $eq…
Abdul-Elah JS
  • 685
  • 1
  • 16
  • 36
1
vote
1 answer

how to return session users data only in sails.js?

I have a User model and user model has one to many relationship with Episode model. Is it possible to send only Episodes which are associated with the current user without changing the EpisodeController?
lacexd
  • 903
  • 1
  • 7
  • 22
1
vote
2 answers

JavaScript Ember with Sails

I'm working with EmberJS and SailsJS. Now I've been asked to make a statistics page and handle the filtering process in the SailsJS. I have a model for departments and another model for requests the relationship between these models is (request…
Abdul-Elah JS
  • 685
  • 1
  • 16
  • 36
1
vote
1 answer

Sails mongo reconnect

I am using sails 1.0.0-37 and sails-mongo 1.0.0-10 . When sails is lifted, if mongo db server is up and running, everything is okay. If mongo db goes down, and the node.js tries to access the mongo db as part of a functionality and it times out, an…
1
vote
7 answers

Sails.JS - Created user wont return user object

I have a function in my Sails 1.0 application that adds a new user to the MongoDB and then at the end should return the User object as JSON... The User does get added to the collection but it throws an error when trying to get the _id of the new…
xXPhenom22Xx
  • 1,265
  • 5
  • 29
  • 63
1
vote
0 answers

Add unique constraint on a field in multiple collections in MongoDB

I am having 3 collections, say A, B, C. In all 3 collections I have a field for email which is unique in respective collections. But now what I need is that email should be unique through out the database. How can this be achieved? I am using sails…
Foramkumar Parekh
  • 421
  • 1
  • 6
  • 26