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:…
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…
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},
…
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…
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…
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:…
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…
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: {
…
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…
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…
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)' },
…
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…
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…
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…