I would like to add the option for maxTime(ms) for all models find queries, but I don't want to add them one by one in every where. Is there any easy way to implement this?
I am getting a failure whenever I try to add my 15th collection.
errorType': 'Error', 'errorMessage': 'Callback was already called.', 'trace': ['Error: Callback was already called.', '
at eval…
I have a code in node - sails js mongo db code like this, it is for user signup:
signup fn:
try{
let err;
let user = await User.create({req.body}).fetch();
if (!user){
throw new Error('Failed');
}
…
How do we write the aggregation queries in sails js other than sum and average.
Like we have Model.aggregate() method in mongoose so how is the same thing done using sails-mongo
I have a sails js app,
The following codes works fine:
list: async(req, res) => {
Data.find({}).exec((err, data)=>{
if(err){
res.send(500, {message: 'db error'});
}
res.status(200).json({
message: 'Data List',
…
I am getting the error : error: Error: Consistency violation: Unexpected error creating db connection manager: MongoError: Authentication failed. Password is fine and I am able to connect with MongoExpress from another server and Mongo Compass. I…
Here is the request I am sending to create the record in MongoDB. StatusId datatype is an integer, but After create query DB has a string value of statusId. Don't know where I am going wrong. This is giving issue while retrieving the data from the…
I have a list of posts containing userId. When fetching n no.of post, I want to loop throught and get and fetch user data and append them into the post.
But before the loop gets resolved, the function gets return with undefined. After that, the post…
I used cloud MongoDB in sails adapter but when I am running app, it throw an error, can someone help how to solve it?
default: {
adapter: 'sails-mongo',
url:…
I am using sails JS and mongo db for my web app.
my code is working fine. But i am having a doubt.
my database statements are like this:
var a = await users.create({username:username,id:id}).fetch();
No try and catch. No error handling.
it is…
My requirement is for every firewall, the user is going to upload a file. That i will be uploading in memory and save the filename to mongo db.
if there are 3 firewalls, only the last one is getting updated. remaining files are uploaded but location…
I am getting undefined value of recentdate variable.When I print the value using console then It print the value successfully.When I tried to hold the value inside the variable (recentdate) then It give the undefined.I want to store the value in…