MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms.

learn more… | top users | synonyms

0
votes
1answer
16 views

Flattening a 2D array to use map/reduce

I have been trying to get better at functional programming, which includes understanding map/reduce. I wrote a function intended to fill an autocomplete with values. The challenge I was encountering ...
4
votes
2answers
54 views

Get all followers and friends of a Twitter user

I'm trying to find my bug or any potential bottleneck that cause my program to be really slow. The script is to get all the followers and friends and save that in MongoDB. ...
1
vote
0answers
15 views

Pulling data quickly from mongodb with node.js

I am currently struggling with a request I am making to my server that is taking more than 4 seconds! I am using socket.io, express and mongoDB in the back end. I cut out a lot of the cruft to ...
1
vote
0answers
50 views

Game server in Java querying MongoDB for JSON

I was hoping someone would have a look at how I retrieve the questions from the db, parse the JSON and process the results - possibly advise how I could improve efficiency by streamlining my code. I ...
0
votes
1answer
81 views

Multi-player game server accessing and querying MongoDB

I have a remote hosted server that's running Java VM with custom server code for a multiplayer real-time quiz game. The server deals with matchmaking, rooms, lobbies etc. I'm also using a MongoDB on ...
0
votes
0answers
63 views

MongoDB repository, dynamic objects, Razor Templates

I am writing a repository for MongoDB and are looking for some review at its current state. I am looking for ways to improve it without adding complexity. Should I be using a Singelton pattern for ...
2
votes
0answers
24 views

Modify records at one time

Do you think this works well? I.e, do I need to close the database connection at the end? The goal is to be able to upsert and delete many records in one shoot. Here is is an example HTTP POST ...
7
votes
2answers
84 views

Recursive download articles and dump to MongoDB

This is simple code that recursively downloads articles from the public WordPress API: ...
8
votes
1answer
108 views

One-to-many relationship with Python objects

I have built Python objects to simulate a one-to-many relationship and then store the object in a MongoDB instance. I am using lots of composition to achieve what I want. The code works perfectly fine ...
3
votes
1answer
64 views

Realtime chat service

I am new to Node.js and Socket.io. I implemented a realtime chat service that has a chatroom feature. When the actual product is launched, there will be at least 200 concurrent users with 50 groups of ...
0
votes
1answer
30 views
4
votes
1answer
56 views

Tabulating a report

I have a method for generating a report in Python. I want to organize the section about the date into a separate method so I can repeat the report for different dates. What's the best way to ...
1
vote
3answers
60 views

Top-10 lists of occupations, ranked by various attributes

In the code below, all pairs of functions are very similar: set function rankListId is different rankListName is ...
1
vote
1answer
140 views

Node.js Paging with Mongodb

I want to create variable paging on Node.js with MongoDB. I use MongoJS on client side create a request: ...
0
votes
0answers
32 views

Optimizing MongoEngine List Update

This is my model: ...
1
vote
0answers
17 views

Nesting models within models

I am saving data into a MongoDB. The data will be saved into 3 Mongoose models that are hierarchical. A User model contains an ...
2
votes
2answers
94 views

SQL Server to MongoDB Template

Looking for feedback on a set of templates I've just created. I'm planning on converting them to Yeoman but want to make sure they're ready for prime time before doing so. They are currently in ...
3
votes
1answer
55 views

Probability ordering by seller's tariff

I have an instance method (update_priority); it calculates the position of an element, depending on the tariff of its seller. If the seller is of a level3 tariff, ...
2
votes
0answers
30 views

Iterating a list to make API calls

I'm new to JavaScript and was hoping there was a cleaner way to write this. It's a block of code that looks at a group of documents in a collection (called Messages), and makes a call to the GitHub ...
0
votes
0answers
24 views

Gathering emails, phones, URIs, and tag related to a room

I've made a strange method with multiples conditionals, creating a lot of Lists and I was wondering if I could write it in a better and more legible way. ...
1
vote
0answers
154 views

Node.js log parser for mongoDB

I have developed a log parser, the goal is to take whatever log type I can, and convert them in a mongoDB collection. I think I've done a pretty good job at reading whatever type of log are trhown at ...
0
votes
1answer
77 views

Which is a better data structure using mongodb?

I'm still confused which structure is better structure using MongoDB. Place child in parent: ...
0
votes
0answers
99 views

Secure and optimize Mongoose model component

Please help in deciding if this method for a Mongoose model component for user authentication can be made more secure and optimized, for efficiency and platform independence. ...
2
votes
0answers
271 views

Log my external IP address using NodeJS

I've been learning NodeJS recently, and have a small program to get the external IP address on my home network from fugal.net, compare it to the previous IP address, and if there is a change update ...
2
votes
0answers
105 views

NoSQL-based sequence generator

For my web application I have to generate a sequence of following format: <year><sometext><month><sequence> For example: ...
4
votes
2answers
95 views

Querying MongoDB for information on a collection of books

I have this huge chunk of code. Is there any better to write this code, or am I too paranoid that I check every MongoDB query for error? The logic is here: Bookcollection = collection of books Book ...
3
votes
2answers
909 views

Node.js script may have memory leak

I use this node.js script to migrate MongoDB collection to a schema to another. It does work if the collection is <20k documents, but slows down to a crawl and sometime throw a FATAL ERROR: JS ...
2
votes
0answers
40 views

Parsing CSVs for bulk database insertions

I'm writing this as (eventually) part of a larger program. This will serve as the bulk data insertion from .csv files we parse. I'm primarily looking for parts that are breaking Go's formatting, ...
3
votes
1answer
762 views

Node js single mongodb connection

I want my entire node application to use one single mongodb connection, at least that's what I think is better. I wrote this little script and want some feedback on it. Especially if what I'm doing ...
1
vote
0answers
31 views

Structuring my application documents

I'm just starting out on an application and I've heard some good things about MongoDB so I thought I'd give it a crack in this new project to see how well it works. Please bear in mind that prior to ...
14
votes
1answer
164 views

Making an efficient and healthy db call for a real-time browser game

I'm doing a calculation for a real-time browser game, where users can invest some of their balances to the site. I need to update their invest's based on ...
2
votes
1answer
40 views

Migrating Data in Mongo

I have the follow script to change my data within Mongo DB: ...
2
votes
1answer
91 views

NoSQL schema for weather data

I am using NodeJS and MongoDB for a weather app that takes the weather info from a logger, saves it to a database, and relays the data to the browser in real-time. It is hosted here with code here ...
5
votes
1answer
223 views

E-commerce product price tracker

I building a very simple price tracker web app. I am using MongoDB with pymongo. The user will enter the URL of the product he wishes to track and the desired amount, when the price goes below this ...
2
votes
1answer
119 views

Views Counter made in Python, Gevent and MongoDB

I've created a Views Counter in Python, Gevent and MongoDB (Flask is also included in the full stack as you can see from the context issue in the code). My gut still tells me that it can be still ...
4
votes
2answers
828 views

Modularize this node.js express server code for routes and session handlers?

I have express node.js server code using Passport. It receives a user to authenticate it and ...
10
votes
2answers
608 views

NodeJS broker between MongoDB and RabbitMQ

I wrote a small program that aims to take some data from the MongoDB database and put them in the RabbitMQ queue. I tried to use only promise style but I am a beginner in JavaScript. Could you please ...
1
vote
2answers
705 views

Number of Google search results over a period of time, saved to database

I am writing a Python script that scrapes data from Google search results and stores it in a database. I couldn't find any Google API for this, so I am just sending a HTTP GET request on Google's main ...
0
votes
1answer
74 views

Class for connecting to mongodb databases and return collection object

This code connects to a mongodb database and returns collection objects. I am concerned about the exception handling, variable names and comments. ...
4
votes
1answer
1k views

Optimizing async joins for mongodb (mongoose) using async.js

I'm building a media viewer web app for a kiosk in node that uses data in mongo. To render the viewer, it gathers together all the Asset objects (representing video files), each of which belong to a ...
2
votes
1answer
212 views

Thoughts on this conversion of code from Step.js to Q promise library?

I have some code that I'd written using this pattern with Step.js. In this case, talking to MongoDB in Node: ...
1
vote
1answer
185 views

Transform a MongoDb parent reference tree into a deep nested tree

Given a mongodb collection that stores trees as nodes with parent references this methods returns a deep nested tree where every child nodes are stored in a property childs[Seq] ...
1
vote
1answer
218 views

Update user's last login date

This function updates the user last login date on the user collection. I guess there are too many brackets and much spaghetti. How can I shorten this code? ...
3
votes
1answer
71 views

Customer MapReduce implementation

I would love a second opinion / another pair of eyes on this. ...
6
votes
1answer
5k views

Seeding MongoDB using Mongoose models

I'm using mongoose to seed a mongodb database based on my mongoose models. I'm particular interested in improving the seed code. I have two models, an article and a category. The relationship between ...
5
votes
1answer
466 views

MongoDB inventory system

I am trying to develop a simple inventory system that takes JSON data gathered from a Powershell script, inputs the data into a MongoDB, and displays the info in an interesting manner for the user. It ...
3
votes
1answer
386 views

Tornado quiz app

I am writing a simple quiz app using Tornado and MongoDB. The user authentication is done using Facebook and each user is uniquely identified by their Facebook ID. When a user first creates an ...
0
votes
1answer
849 views

Upload document to mongodb

Simple post and download web app in Bottle: server.py ...
3
votes
1answer
98 views

Tornado PyMongo product wishlist

I am writing a Tornado app in which a user can maintain his products wishlist. There are two collections, users and products. As ...
4
votes
1answer
743 views

Node.js chat client

This is a chat using Node.js, socket.io and MongoDB for storage. I'd appreciate any feedback on what can be improved. I understand that this allows for non-unique usernames to be used, and it's ...