Insert streamed XML data database

I am trying to efficiently insert a lot of data (XML file is over 70GB in size) without crashing my MongoDB server. Currently this is what I am doing using xml-stream in NodeJS: var fs = require('fs'), path = require('path'), XmlStream = req...
more »

2017-08-06 00:08 (1) Answers

MongoDB/PHP: search for string with query

EDIT: I solved it. Just need to use "MongoDB\BSON\Regex". I'm storing books as documents in MongoDB, with the individual pages stored as strings in an array. I'm trying to implement a search page that can take a string and return all documents that ...
more »

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

Using ObjectID with jwt.sign() and verify()

Upon logging in to my system, I run the MongoDB _id of the logged in user through the jsonwebtoken's sign method. It returns to me a hash, which I then put into the session headers of every subsequent request that the client makes to my server. I no...
more »

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

map json nested object from mongodb to java

I'm getting json object on my mongodb with virustotal API This is how a json object stored in mongodb object looks like : { "_id" : ObjectId("597cd2f871eac714388b2f7f"), "results" : { "scans" : { "Bkav" : { "detected" : true...
more »

2017-07-31 06:07 (2) Answers

How to get value from router request?

I have created an angular app. In this app, I want to add a search. for this, I have a textbox and a button. Textbox name is name="search" I have a get method in API. router.get('/allActivities', (req, res) => { Activity.find({ name: req....
more »

2017-07-28 07:07 (1) Answers

MongoDb find multiple fields

Bonjour Je rencontre un problème pour construire ma requete mongodb Voici ma requte SQL select ID from TABLE where (compatibility like '%motclee1%' OR type like '%motclee1%') AND (compatibility like '%motclee2%' OR type like '%motclee2%') AND (compa...
more »

2017-07-27 15:07 (0) Answers

mongodb underscore wildcard search

I am a newbie to mongodb. I just want to know what is the Mongodb equivalent operator for mysql _ for wildcard search. For example in mysql if want to search a phone number column in the format of 123 456 7890 we can search like '_ _ ____'. How do we...
more »

2017-07-27 14:07 (1) Answers

Fuzzy Searching with Mongodb: No results

I have implemented fuzzy searching using regex as shown below. I'm trying to figure out how to display something if no results are found from the search. How would I display: "No results found." If none are found? Thanks! function escapeRegex(text...
more »

2017-07-20 21:07 (0) Answers

Can't install Mongo gem - make failed, exit code 1

I've installed Ruby 2.4.0 on Windows via the RubyInstaller. Ruby works fine and I've been able to install all the gems I've wanted so far. But I'm having issues installing the mongo gem. When I do gem install mongo --no-rdoc --no-ri I get the follo...
more »

2017-07-19 12:07 (1) Answers

JAVA bean design for embedded beans

I am using java backend to connect with my mongo database and i am designing my bean class . I am using jersey-jackson for rest services.I am using jackson's java bean mapping for receiving data from post method. Not i have a collection called TastTa...
more »

2017-07-08 16:07 (0) Answers

MongoDB: Indexing for a live search

Situation I need to create a live search with MongoDB. But I don't know, which index is better to use normal or text. Yesterday I found main differences between them. I have a following document: { title: 'What vitamins are found in blueberries...
more »

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

Find query not working with node.js

So I have collected the username and password entered by the users in the username and password variables respectively. But when I use this username variable inside find query then it is returning an empty document even though there is a record pres...
more »

2017-06-26 15:06 (0) Answers

Mongo import saves all data under a single object

I ran a mongo import command to import my json file, but all the data got saved under a single object. mongoimport -d DB NAME -c COLLECTION NAME --type json --file FILE PATH --host MY MONGO LAB HOST --port 27892 -u MYUSER -p MYPASSWORD But now whe...
more »

2017-06-17 19:06 (1) Answers

Issue with mongify check database.config

I am running the command: mongify check database.config But I am getting this error: C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec': Specified 'mys...
more »

2017-06-15 09:06 (0) Answers

Mysql To MongoDb design Issue

I am planning to move my mysql db of chat_latest and chat_messages to mongodb. Old Mysql tables: chat_latest: User1 User2 LatestState 1 2 Accepted 1 3 Declined chat_messages: sender datetime body stateWhileMessageWasSend d...
more »

2017-06-13 09:06 (0) Answers

MongoDB killed by linux

My mongoDB always receives a KILL signal when it is a few hours without being accessed and I do not know the reason. I'm using: S.O: Ubuntu 16.04 with 512MB ram. Running node 7.5.0 in pm2. MongoDB version 3.4.1 status mongod: mongod.service - High...
more »

2017-06-02 21:06 (0) Answers

Docs generation in Mongoose schema

Let's say I have schema like this: var schema = new Schema({ name: String, ofString: [String], ofNumber: [Number], ofMixed: [Schema.Types.Mixed], ofObjectId: [Schema.Types.ObjectId], nested: { stuff: { type: String, lowerca...
more »

2017-06-02 10:06 (1) Answers

Mongodb check if find works

I want to check if a document exists in my table users. How can I check the return value of find to make it be automatic echo "db.users.find({username : \"test\"})" | mongo users if [ "$!" = "0" ] then echo "OK" fi This doesn't work because fi...
more »

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