pymongo to RMongo, mongodb sort query

In pymongo I'm doing a sort query like this: from pymongo import MongoClient client = MongoClient() dbase = client[dbname] collection = dbase[symbol] start = time.time() cursor = collection.find().sort([{'_id', -1}]).limit(6000) data = list(cursor) ...
more »

2017-04-12 20:04 (1) Answers

PHP Mongodb on Mac OS

I've got problem with mongodb when I run a php script on Mac OS. I run the php to connect mongodb and I get this errors: dyld: lazy symbol binding failed: Symbol not found: _clock_gettime Referenced from: /usr/local/opt/php56-mongodb/mongodb....
more »

2017-04-09 20:04 (0) Answers

Understanding how ReactJS and NodeJS app can work

I'm trying to learn React JS, but I have difficulties understanding how it should work with NodeJS, let's say with Express. So far I understand that ReactJS is "V" in "MVC" This is easy, I can already write a code using create-react-app This is how...
more »

2017-04-09 15:04 (1) Answers

How to sum two field in laravel mongodb?

I get reference from here : https://github.com/jenssegers/laravel-mongodb If in mysql query like this : SELECT SUM(tota_salary), SUM(total_player) FROM club WHERE code_club = 9 I want change it in laravel eloquent From documentation laravel mon...
more »

2017-04-08 14:04 (1) Answers

javascript object array is not changed

This code is about fetching data from MongoDB and changing '_id' element to 'id element. But I found object array is not changed. router.get('/loadList', (req,res) => { Post.find({}, (err, list) => { //fetching data to list if(err...
more »

2017-04-07 08:04 (1) Answers

Promises and upserting to database in bulk

I am currently parsing a list of js objects that are upserted to the db one by one, roughly like this with Node.js: return promise.map(list, return parseItem(item) .then(upsertSingleItemToDB) ).then(all finished!) The problem is th...
more »

2017-04-04 16:04 (2) Answers

Error in mongodb export in node,js

I was trying to connect mongodb using node.js. I stumbled on a problem. I am getting require(...).pure is not a function error . I tried to use the exact code from this site "https://mongodb.github.io/node-mongodb-native/api-generated/collection.h...
more »

2017-04-03 11:04 (1) Answers

Cant get mongoose-unique-validator to work

it cant be that difficult, but I'm always getting the default mongoose 11000 error. Here is a simplified version of my code: model import mongoose from 'mongoose'; import uniqueValidator from 'mongoose-unique-validator'; const UserSchema = new mo...
more »

2017-03-31 19:03 (0) Answers

Mongo Query That Sorts All Data Minus Null Data

I'm trying to run a query that sorts my data (data collected about airplane flights) by highest altitude recorded. When i run a sort aggregation from descending order, all entries with a "null" value for altitude are displayed first. I've tried to ru...
more »

2017-03-27 09:03 (1) Answers

Spring boot : Create a User with MongoDB

Okay so i've a question : How to create a user with spring ? I learn some informations and the best way to do it's use the UserDetails ... But I can't find informations to use with good practice : UserDetails with mongodb. When i have my...
more »

2017-03-21 13:03 (1) Answers

Caching query results in MongoDB

I will be working on a large data set that changes slowly so I want to optimize the query result time by using a caching mechanism. For example , if I want to see some metrics about the data from the last 360 days I don't need to query the database a...
more »

2017-03-20 09:03 (1) Answers

How to filter by numbers with Node-RED REST-API

I created a small REST-API for my MongoDB with Node-RED. This works fine: <node-red-url>:<node-red-port>/rest/demo shows me all entries. I can even filter the result: Appending ?userName=demo shows only entries where {userName: "demo"}....
more »

2017-03-16 16:03 (1) Answers

How can I use "not like" on laravel mongodb?

I see here : https://github.com/jenssegers/laravel-mongodb I try : $user = Comment::where('body', 'like', '%spam%')->get(); It works But when I try : $user = Comment::where('body', 'not like', '%spam%')->get(); It does not work Seems ...
more »

2017-03-15 16:03 (1) Answers

Sort Data In Node.JS

I am using Node.JS and MongoDB. I've created a report with CSV file and this is my code, function buildListCsvContent() { var array = []; var counter = 0; for (var i = 0; i < vm.student.length; i++) { var row = { No: coun...
more »

2017-03-14 16:03 (2) Answers

How does Top-K sort algorithm work in MongoDB

Based on the answer and from MongoDB Documentation, I understood that MongoDB is able to sort a large data set and provide sorted results when limit() is used. However, when the same data set is queried using sort() results into a memory exception. ...
more »

2017-03-13 16:03 (1) Answers