Questions tagged [sails-mongo]

MongoDB adapter for Sails.js

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

400 questions
0
votes
1 answer

Envelope: Cannot read property 'id' of undefined in sails.js

Envelope: Cannot read property 'id' of undefined in sails.js Whenever i have have send create request they give me above error, model : Car.js module.exports = { attributes: { name: { type: 'string', required: true, unique:…
0
votes
1 answer

image not getting displayed on html page using sails js

I am using sails Js and Mongo DB in my application. I upload an image and content for a blog post. I save it in images folder.I save the file destination and content to my mongodb. using the file destination, I want to display the content and image…
Surendar
  • 153
  • 3
  • 11
0
votes
1 answer

Cannot read property 'columnName' of undefined in sails Js Mongo DB

I am using sails JS with Mongo DB. My model is: module.exports = { attributes: { title:{type:"string",required:true}, content:{type:"string",required:true}, date:{type:"string",required:true}, …
Surendar
  • 153
  • 3
  • 11
0
votes
1 answer

Ajax POST request json data undefined using Sails.js and Mongodb

I am trying to make a post request using AJAX request, to be able to store it in the database. I have a button using the onclick event to call the usernameCheck() function, inside of my bundle.js file created with browserify. My DataController.js…
John Shin
  • 45
  • 8
0
votes
1 answer

SailsJS verson ^1 need to set case sensitivity on queries to false

I'm using SailsJS with mongoDB. Recently I updated from sails o.12 to 1.2.3. All working fine until, I found out that my queries are now case sensitive. I need to set it to false because of it caused much trouble in various scenarios and some are…
0
votes
1 answer

One way association with array of reference _id in sails js

I'm trying to use one way association because I need only to have reference from 1 model to other model but not vice versa. Model Arts: module.exports = { attributes: { fileName: {type: 'string', required: true}, softwareUsed: { model:…
noyruto88
  • 767
  • 2
  • 18
  • 40
0
votes
1 answer

One-to-many association in sails.js creation failure

Sails.js application fails to create one-to-many relationship in mongo db: According to official Documentation I created two linked one-to-many entities, Post-Likes. I located them in api/models folder and defined as follows: Like.js module.exports…
Ievgen
  • 1,999
  • 2
  • 12
  • 24
0
votes
1 answer

MongoDB SailsJS: Prevent Model.create() if it has undeclared attributes

Is there a way to prevent an attribute to store, when if the attribute is not required in api/models/YourModel? For example, let's say I used MongoDB, and I have this Master model: module.exports = { schema: true, attributes: { …
0
votes
2 answers

How to prevent insert of data that is passed using query string in sails.js for post request?

I have created new table in mysql also created model and controller in sails.js. Now I am trying to insert data using sails. As we know when we create new modal in sails it will create new post, get and other api for us by default. Now I am trying…
baj9032
  • 2,414
  • 3
  • 22
  • 40
0
votes
1 answer

In MongoDB how to know if it is the last record of a collection?

How to know if I'm returning the last set of document/documents of a collection? For now I keep the full document count as reference to check if I received the all the records. I'm using skip with limit for lazy loading. Is there a better way to do…
0
votes
0 answers

Sails JS : Can we use different field than primary key as foreign key?

I am using MongoDB and SailsJS for developing a web-app. Here are the models. USER MODEL module.exports = { tableName : 'users', attributes: { firstname: { type: 'string', required: true, columnType: 'varchar(55)' }, …
BlueSuiter
  • 527
  • 6
  • 21
0
votes
0 answers

type number is storing upto 10 character in sails-mongo

I am using SailsJS with MongoDB and model is having type number as below: attributes: { mobile_no: { type: 'number' } } So when I insert with API it is working perfectly up to 10 numeric character length. For more than 10+ numeric…
Mysterious Coder
  • 148
  • 2
  • 4
  • 20
0
votes
0 answers

Sails JS not able to get Path params as object and not able to modify it

I have created the middleware, where i am able to modify request.body and request.query as I am getting it as object but I am not able to get path params as object because in sails request.params gives array type with values in URL format instead of…
Soorya Prakash
  • 921
  • 3
  • 9
  • 29
0
votes
1 answer

want to use _id instead of id in waterline with mongodb

I have a case where I need to change the default referencing of primary key name id with _id for all the models in a given project I am working. There is an express.js + mongoose setup which is in production. The data present in the database is…
0
votes
2 answers

A hook (`orm`) failed to load while using sails-mongo in sails version 1

Sails Version: 1.2.3 Node Version: v10.14.2 Sails Mongo Version: 1.0.1 Datastore configuration: default: { adapter: 'sails-mongo', url: 'mongodb://user:password@xxx.xxx.xxx.xxx:27017/user_db' The password consists of special…
Mithun Shreevatsa
  • 3,588
  • 9
  • 50
  • 95