mongoDB utility class
Hi, Is there a "MongoUtil" class that allows me to get a new connection in a multi-threading environment (like the so famous HibernateUtil class)? Thanks ...
Hi, Is there a "MongoUtil" class that allows me to get a new connection in a multi-threading environment (like the so famous HibernateUtil class)? Thanks ...
I am using the MongoDB-Csharp driver and I was wondering what the proper way to insert and query date field? I tried using storing the dates using System.DateTime, but I am having issues when I try to query by date. example: Inserting Data var mongo = new Mongo(); var db = mongo.GetDatabase(dbName); var collection = db.GetCollection(...
Sort of a mongo noob, and I have a feeling I am tackling this problem from the wrong direction. I have about a 7 million document collection. Each document has two fields that I want to modify (not replace), basically they are big strings that have \\n, and I want to replace those with \n. I spent about an hour trying to find a way to...
I'm having problems with what seems to be a simple sharding setup in mongo. I have two shards, a single mongos instance, and a single config server set up like this: Machine A - 10.0.44.16 - config server, mongos Machine B - 10.0.44.10 - shard 1 Machine C - 10.0.44.11 - shard 2 I have a collection called 'Seeds' that has a shard key '...
I am quite new to both django and mongoengine. Is there any project I can refer to see basic implementation of user authentication and authorization. ...
Have you used MongoEngine or MongoKit with Django? Which one do you prefer? Background: I'm developing a new site and have experience with normal Django development but for the kind of data I'll be using the MongoDB will be better suited than a SQL database. I'm using Python 2.7 and can compile/install anything on my host so that's no...
Given a simple json document such as: { _id: 1234, messages: [...], otherfields: ... } If two people open the document, and push a message onto the array, the first update will be clobbered by the second. For types other than arrays, I'm ok with this. In an rdbms this isn't an issue since the two messages are simply inserted into ...
Hi, I have a project I'm working on and I want to use MongoDb. Description: The programme is a questionnaire for an entity. The entity can be college, faculty or department. A form is captured per year for any of these entities though mostly departments. Queries can be made on any of them. Where needed, the data can be aggregated and u...
Supposed we have something using Mongoid: data: 'products': "2010-09-07": { pageviews: 123 timeOnPage: 1823 } "2010-09-08": { pageviews: 138 timeOnPage: 2607 } ... So 2, 3 years down the road, there will be 700 or 1000 dates mapping to a hash. If we modify 1 number, will it require readin...
Since we can structure a MongoDB any way we want, we can do it this way { products: [ { date: "2010-09-08", data: { pageviews: 23, timeOnPage: 178 }}, { date: "2010-09-09", data: { pageviews: 36, timeOnPage: 202 }} ], brands: [ { date: "2010-09-08", data: { pageviews: 123, timeOnPage: 210 }}, { date: "2010-09-09"...
In the MongoDB page: http://www.mongodb.org/display/DOCS/Inserting doc = { author: 'joe', created : new Date('03/28/2009'), title : 'Yet another blog post', text : 'Here is the text...', tags : [ 'example', 'joe' ], comments : [ { author: 'jim', comment: 'I disagree' }, { author: 'nancy', com...
If You would be Facebook, what nosql db would you use and to do what? I mean the real use cases where a NOSQL makes really an advantage ...
Hi all: This is just for my weekend project/study, I am very new to Sinatra and MongoDB. I've installed the gems for mongoDB, such as: mongo, mongo_mapper and mongoid. When I tried connecting to my database on MongoHQ from localhost, it encountered such an error: Mongo::ConnectionFailure at / failed to connect to any given host:port ...
Hello I have a projects model with just a name field and in it also the embedded relation to line_items. class Project include mongoid::document field :name embeds_many :line_items end class LineItem include mongoid::document field :title embedded_in :project, :inverse_of => :line_items en...
Hi all: I must have done it in a wrong way: the records printed out are out of order, even though they are inserted into db one at a time. Here is the code: get '/' do db = Mongo::Connection.new("localhost", 27017).db("testdb") @notes = db.collection('notes') @notelist = Set.new() @notes.find().each{|record| @notelist.add(recor...
What are some good ways to store Analytics data using MongoDB for future analysis? I am thinking of doing something like: > db.analytics.insert( { page: 'product', id: 123, date: new Date('Sept 8, 2010'), pageviews: 222, timeOnPage: 5432 } ) > db.analytics.find() { "_id" : ObjectId("4c8e04b1f14d4366465197b8"), "...
Hi. Is there a C# MongoDb Driver which supports replica sets? ...
db.foo.find().limit(300) won't do it... it still prints out 20 db.foo.find().toArray() db.foo.find().forEach(printjson) will both print out very expanded view of each document instead of the 1-line version for find(): ...
I've been trying to create a database/model with Mongoose which is basically just a user database where the username is unique. Sounds simple enough, but for some reason I've been unable to do so. What I've got so far is this: var mongoose = require('mongoose').Mongoose, db = mongoose.connect('mongodb://localhost/db'); mongoose.mo...
There are products with a name and price. Users log about products they have bought. # option 1: embed logs product = { id, name, price } user = { id, name, logs : [{ product_id_1, quantity, datetime, comment }, { product_id_2, quantity, datetime, comment }, ... , {...