Using Mongo Cache as a replacement for redis

Currently, i am writing data into redis which is reduced to mongo every 2 minutes. I am wondering if i can use Mongo Cache instead of redis here. This will save the cost of 2 dbs in production.Also,the mongodb page says : The WiredTiger cache st...
more »

2017-05-19 07:05 (0) Answers

Pass large array to node child process

I have complex CPU intensive work I want to do on a large array. Ideally, I'd like to pass this to the child process. var spawn = require('child_process').spawn; // dataAsNumbers is a large 2D array var child = spawn(process.execPath, ['/child_pro...
more »

2017-05-18 18:05 (6) Answers

Removing documents not having @ in mongodb

I am created a mongodb and in the I am filling my client email addresses and there related accounts. But I have found that some values listed as email are not email at all. See the below example. { "_id" : ObjectId("591d9cf30ef9acde11d7af6b"...
more »

2017-05-18 16:05 (1) Answers

Mongo @Query vulnerable to SQL/No-SQL Injection?

I'm developing a Spring MVC web based app and I'm using MongoDB with MongoRepository interface for persistence. In some of my queries to the DB, I don't use the MongoRepository (or CrudRepository) reflection method naming like findByEmail(string emal...
more »

2017-05-16 09:05 (0) Answers

MongoDB document validation fail

Trying to test the validation of the document below: db.createCollection("Users", { validator: { $and: [ { Uid: { $type: "string", $exists: true } }, { "Doc.Name": { $type: "stri...
more »

2017-05-13 22:05 (0) Answers

Security on MLab Access on React Frontend

I would like to render highcharts on my react frontend. The data is coming from my mlab mongodb. There is native mongodb drivers available, I dont know though, whether I can expose my password and user on the react frontend. Is there any security iss...
more »

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

delete item by date in mongodb using php

I need to delete a mongodb element using php based on the date of the element When i fetch the Date of the element without any formatting or conversion i get this as an output 0.52400000 I dont know which format this is but by using date...
more »

2017-05-12 12:05 (1) Answers

Query MongoDb records from 5 days ago using '_id'

I've read online that '_id' holds a timestamp on when it was created and you are able to query it depending on a date. This is what I've I tried so far, but not having any luck. var d = new Date(); d.setDate(d.getDate() - 5); collection.find( { }, ...
more »

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

Will this create any security exploit?

I've a mongodb collection "users" in which i want to add a new field "wallet_amount" when user add money in their wallet. Right now at the time of user registration, i'm trying to insert a document like this db.users.insert( { email: "test@test.com"...
more »

2017-05-05 18:05 (1) Answers

Mongoose sort, ascending and $exists

I wonder if there is a way in mongoose that I can sort a query on a collection in ascending order on a certain field where that field also gets sorted on $exist. I mean the following query sorts like I want but puts the documents with no track.nextRu...
more »

2017-05-04 16:05 (0) Answers

MongoDB Validator on Array of Objects

Lets say I've got an Events collection that has documents that look like this: { name: "myevent", invitees: [ { name: "mike", bff_level: 3 }, { name: "michelle", bff_level: 2 } ] } I want to enforce t...
more »

2017-05-02 01:05 (0) Answers

importing CSV file MongoDB with ISODate

When I export my data from mongoDB I obtain the following file: Everything is a string in the mongoDB except for the date that is ISODate. 123@123.com,sha1:64000:18:BTJnM903gIt5FNlSsZIRx1tLC9ErPJuB:9YVs800sgRPr1aaLj73qqnJ6,123,123,123@123.com,2017-...
more »

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

Storing sensitive information mongoose nodejs

I've an application which consists stores some very sensitive information such as social security number and others banking information. For normal login, i'm working on using salt or any hash functions. But will this mechanism be feasible for storin...
more »

2017-04-27 18:04 (0) Answers

Most efficient way to denormalize results at scale

Wondering what's the most efficient way to denormalize data that is read often? For example, say I have 10 million ratings for 1000 items. Each rating contains a user ID, item ID, rating value, and date. When browsing rating pages, I want to update...
more »

2017-04-24 21:04 (0) Answers

Installing MongoDB with 'wget' Command

I am having trouble installing MongoDB using the wget command. Right now, I am running the following command in Mac's terminal to install Mongo: $ wget https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-3.4.4.tgz Note: I am using OS X El Capita...
more »

2017-04-23 17:04 (1) Answers

access function not returning Either Failure a

I am having some difficulty with the Haskell mongoDB driver and the return type of the access function. According to the hackage documentation and the tutorial on the haskell-mongodb github page, access should have the type MonadIO m => Pipe -&g...
more »

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