MongoDB is a scalable, high-performance, open source, document-oriented database. It supports a large number of languages and application development platforms.
4
votes
1answer
46 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
54 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
23 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, ...
0
votes
0answers
7 views
Proper tree NoSQL structure with focus on full-text searching [migrated]
I developing an app with tree(folder-file) structure, on which I should perform full-text searches with MongoDB. I did a research on the best tree structure practices and found this great article, but ...
2
votes
1answer
28 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
19 views
Structuring my MongoDB 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 ...
13
votes
1answer
140 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
31 views
0
votes
0answers
29 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 ...
0
votes
0answers
30 views
Is there a better way of designing this MongoDB schema?
My schema is based around a JSON response I'm getting from an API call. A gist of which is like so:
...
5
votes
1answer
120 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
82 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
427 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 ...
8
votes
2answers
315 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
272 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
56 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
690 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
122 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
109 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
159 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
61 views
6
votes
1answer
2k 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
193 views
A mongodb inventory system — More efficient db calls?
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
199 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
581 views
3
votes
0answers
58 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
494 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 ...
2
votes
0answers
207 views
Python app-level document/record locking (eg. for MongoDB)
Introduction
MongoDB does not provide means to lock a document (like SELECT FOR UPDATE in RDBMS).
There is recommended approach to Isolate Sequence of Operations, which is sometimes called ...
3
votes
0answers
747 views
Recursive JSON walk in Python [closed]
I wrote this JSON walker to help with moving objects around while updating Legacy JSONs to match a new schema. Please let me know how I could further optimize it, or more importantly, make it easier ...
1
vote
0answers
334 views
Handling multiple Mongodb connections in Node.js (using Mongolia)
I have a situation where I have multiple objects that each needs to connect to a different mongodb uri.
I am currently testing this using mongolia but the concept should be the same if I were to use ...
5
votes
1answer
1k views
2
votes
1answer
329 views
Saving and listing Category model
I have this ExpressJS route for saving and listing Category model.
...
3
votes
0answers
1k views
Is there a better way to convert a MongoDB BsonDocument to XML using C#?
Leaving aside the slightly dubious nature of the request (it's a feature I have to honour, regardless of whether I agree with it, and I'll never be reversing the conversion process), I have devised ...
1
vote
1answer
147 views
Python flask web app, simplification
I am writing web application using flask framework + mongodb. I have an issue, should I use classes for my mongo entities or just use dictionaries for them.
...
6
votes
2answers
576 views
Simple telephone address book
I am new to Java programming, and to help me learn, I created a simple telephone address book. The code runs as expected, but I would be interested to here from more advanced programmers if they ...
1
vote
1answer
150 views
Can this MongoDB query be optimized further?
Most of my slow queries on my server are due to a single "find" query.
I have a collection that represents website pages. I want to be able to look up a page in the collection by URL. The caveat is ...
1
vote
1answer
111 views
SQL vs MongoDB (TCG collection managment) [closed]
I'm designing a web application to help some friends and I manage our card collection. A relational database makes sense to me, so that was my first instinct.
The basic schema would like something ...
2
votes
2answers
109 views
Using Types to Designing Domain
I am trying to model a domain of metrics for use in a BI application. I recently read the Designing with Types series, and felt that it could be useful, so I wanted to give it a try. What I'm not ...
1
vote
0answers
77 views
Basic commenting structure for commenting on objects
I would dearly love some feedback on the model below. It's a basic commenting structure where users can comment on a variety of objects in the model. I have denormalised it to make querying simpler, ...