How can I make a model join query(condition) and sort on relation models on Sails?
Example: I have 4 tables(collections in mongodb) and 4 related models in mongodb:
User: user_id, name
Follow: user_id, following_id (user id is being…
i have a model that it has some json type attribute and now I want to use find on this json attribute. may please help how can i do it?
model:
module.exports = {
attributes: {
ownerInfo: {
type: 'json',
description: 'owner info…
I need to fetch data from mongodb similer to the below sql query:
select * from ar_pages where (slug='ettarc' or id in ('1','2','3','4'))
Which uses one search condition and another with IN clause (fetch pages with specified slug and pages with…
I need to add ObjectId in nested collection in MongoDB, and i just upgrade my sails version, now when I'm going to update my collection and there is nested object have object id it's giving me below error
AdapterError: Unexpected error from…
I am creating a new record like this:
Resource.create({
title: req.body.title,
address: {...req.body.address},
email: req.body.email,
}, (err, record) =>{
if(err){
res.send({'status': err});
}else{
res.send(
…
I'm using:
"sails": "1.2.1",
"sails-mongo": "1.0.1"
when i get documents of a mongodb collection, i've got error like this:
In model `archive`:
debug: The default primary key attribute (`id`) is not set up correctly.
debug: When using…
I´m trying to figure out how to use Sails.js with the node-machine-syntax. This is the list action of my flights, simple, nothing crazy.
I´m trying this:
/**
* FlightsController
*
* @description :: Server-side actions for handling incoming…
I want to remove all members that a collection has , but I do not want to pass every member ID to .member() method .
waterline documentation explain a way to delete specific members like :
await User.removeFromCollection(3,…
I recently updated Sails from 0.12 to 1.0.2 on my laptop and started a new project. I'm trying to connect to a MongoDB database using sails-mongo but I get the following error:
my-app_1 | error: A hook (`orm`) failed to load!
my-app_1 | error:…
I am trying below queries to get the output which has start_date greater than current date.
These in structure of my collection:
{
"_id" : ObjectId("5aeac6cd1b7e6f252832ca0e"),
"recruiter_id" : null,
"university_id" : null,
…
After upgrading to sails v1 all the requests in the controllers became case sensitive.
Although this is expected, commented here: https://sailsjs.com/documentation/concepts/models-and-orm/models#?case-sensitivity, I would like to have case…
I am building an App on SailsJS and am using MongoDb using sails-mongoose hook. The server automatically crashes and shuts down mentioning the error shown below.
I observe that it mainly happens when my computer goes in sleep mode. I am not sure if…
I am trying to move mysql data to MongoDB. The record is over 3million rows. And every time it runs out of memory even after modifying my node start script
"scripts": {
"debug": "node debug app.js",
"start": "node --max_old_space_size=5120…
I have a sails app working with just a simple index and simple create (insert) to a mongo db. When I enter correctly typed data hard coded to be the type stated in the model, I get an error.
url insert err = [Error (E_VALIDATION) 1 attribute is…
I am creating an application where a user can have many rooms and each room can have many channels, here is my code when retrieving the rooms and corresponding channels:
getRooms: function (req, res) {
User.find({id:…