[02:19:07] <ddod> Question: I have a db of articles in different categories. Is there a single query to get a per-category limit? As in, 10 articles from each category. Bonus points for the node-mongodb-nativeā query. My current query: articles.find({categories: { $in: ['news', 'opinion'] }).sort({'date': -1}).limit(10).toArray()
[02:22:07] <Node_034> Question: I have a question regarding Mongoose queries. I have a database of posts in various threads, when I query for a group of threads I can usually populate them when I've queried for them. However, how would I go about populating the posts inside the group of threads?
[02:26:06] <rkgarcia> ddod an Node_034 are the same?
[08:50:23] <palominoz> Hello there. Any suggestions or best practice for architecturing a localized data model on mongodb? i am looking at objectives 1. reducing effort(SLOC to serialize / deserialize objects) to respond to HTTP Content-language headers 2. mantain high performance on queries even with lots of data
[08:58:48] <Nodex> how about asking the question without using big fancy words?
[09:02:50] <palominoz> ok. sorry for the big words. i was wondering where to store localized attributes of my documents, while keeping clean source code and mantain high performance. is it more clear?
[09:03:49] <Nodex> what do you mean by localized attributes?
[09:04:13] <palominoz> e.g. Product : { name: "my localized string" }
[09:04:43] <Nodex> right, so you want to do a load of joins in effect ?
[09:05:12] <palominoz> one solution could be Product : { locales: { en: { "name": "Car"}, it:{"name":"Automobile" }}}
[11:24:53] <KraK> Hello, I have a php host and I wanted to know if there is a way to have my own Mongodb server on it so I could use it for angularjs, thanks
[11:34:09] <kees_> that 'php host' can you install anything on it?
[11:34:46] <KraK> I don't think so, I just checked their FAQ, you need to get a VPS and install it on it
[14:58:14] <spicewiesel> hi all, just a short question: I enabled profiling via db.setProfilingLevel(1,50) on all mongod instances in the replicaset. Today, 2 weeks later, the profiling level was back to 0 at the hosts. Does anyone know how this can happen?
[15:24:38] <joannac> spicewiesel: the instance was restarted? or someone changed it back?
[15:25:40] <spicewiesel> will this be resetted with a restart?
[15:26:03] <spicewiesel> I thought only the content of the used capped collection will be flushed, not the profling setting itself
[15:32:36] <joannac> you can set it on the command line: mongod --profile=1 --slowms=15
[15:36:52] <Striki> how fast is count with 1 regex match? the field is indexed but the collection has 525 million documents. I've read about issues with slow count queries, just wondering what the status of it is today. the regex match is in the recommended form, with "starts at" and "ends at", checks for 49 symbols on 1 indexes field
[16:01:13] <bensons> hi, if i have sharding active for a collection, hashed as sharding key; when i now add a new shard (replset) data will be reblanaced. is there any way to avoid that for hased shardkey?
[16:06:19] <kali> bensons: well, you can stop the balancer, but what's the point ?
[16:07:21] <bensons> kali: well lets say i have 3 shards(replsets) and i want 1 collection to be spread across shard1/shard2 and another across shard2/shard3
[16:08:03] <kali> well, stop the balancer and move the chunks yourself
[16:08:16] <kali> i'm not sure if that is really recommended
[16:08:27] <kali> you'd better check out what the documentation says :)
[16:08:54] <bensons> sure i can manually set split points and move chukns
[16:09:10] <bensons> but since the sharding key is id hashed its not possible (from what i understand) to set split points
[16:14:20] <kali> bensons: what about this ? http://docs.mongodb.org/manual/reference/command/split/#split-a-chunk-using-values-of-a-hashed-shard-key
[16:17:16] <bensons> kali: yeah ok that could work :)
[17:10:08] <Rhaven> Hello, i'm using mms and i have some troubles with sharded cluster detection through a mongos. There is no other member except the mongos used for the detection.
[17:45:37] <andrewjacobs> hello everyone, i am using the latest mongodb and C# library, I am running into an error when I try to populate a object[] with a query contain email
[17:46:51] <andrewjacobs> http://pastebin.com/Dxq1ELcZ is a sample code
[17:47:19] <andrewjacobs> it throws an exception when trying to execute var result
[17:54:14] <andrewjacobs> It produces this exception: http://pastebin.com/wEGXLxzJ
[18:29:55] <dmarkey> if i have two documents {"version" : "2.0"} and {"version": "3.0"} , can I do an aggregate query to count the different versions and the total?
[18:45:50] <Rhaven> Hello, i'm using mms and i have some troubles with sharded cluster detection through a mongos. There is no other member except the mongos used for the detection.
[19:02:06] <Rhaven1> But nothing about pulling the informations about my cluster
[19:34:23] <tristan1990> Hey guys. I have a problem connecting MongoDB to Node. If anybody could help then I have detailed the setup here - http://pastebin.com/ENx9S7M6
[19:37:17] <a13x2121> i added a new user to db admin, i can authenticate but getting a unauthorized when running show dbs
[20:24:08] <tristan1990> what I want to do it connect it to an external database now
[20:24:44] <tristan1990> I am also using this with the above https://github.com/ccoenraets/cordova-tutorial/blob/master/www/js/adapters/jsonp-adapter.js
[20:25:15] <tristan1990> so basically I fire up the mongoDB, nodeJS server and then the node app works
[20:25:42] <tristan1990> I want to now connect that code to my MongoLab hosted DB, rather than running locally
[20:26:05] <tristan1990> The problem is that I don't know where to start to connect it
[20:26:26] <tristan1990> Above is a pastebin explaining the setup in a bit more detail
[20:33:57] <rkgarcia> I don't know the problem tristan1990 :(
[20:34:47] <tristan1990> rkgarcia: I thought I had a problem but actually I think I just need some help and fresh thinking on the project :(
[20:35:33] <tristan1990> I have a rather large MongoDB hosted on MongoLabs
[20:35:54] <tristan1990> The DB is full of Opening Time information for shops in the UK.
[20:36:29] <tristan1990> I want to make a really simple app using PhoneGap that just searches the MongoDB for the shop the user wants
[20:37:19] <tristan1990> I thought a good place to start would be using a tutorial for PhoneGap to create an employee directory. My thinking was that it had a simple search bar that searches for content on a mongodb (local)
[20:38:27] <tristan1990> The tutorial worked and I have edited the looks of the app to meet my requirements. I want to now make the app read the MongoLabs hosted database rather than the one I started running on my mac
[20:39:32] <tristan1990> this is the tut I followed - https://github.com/ccoenraets/directory-backbone-bootstrap and I added the extra file - directory-rest-nodejs from the same guy's github.
[20:40:04] <tristan1990> This worked so that I started the mongodb, started up nodejs server and then I could use the app as per the tutorial.
[20:40:16] <rkgarcia> i know node, i don't use cordova (PhoneGap)
[20:40:22] <tristan1990> Basically from here I want to connect it to my external DB
[20:40:46] <rkgarcia> ok, in node you need "npm install mongodb"
[20:40:53] <rkgarcia> this install the mongodb driver for node
[20:41:12] <tristan1990> actually cordova is irrelevent.. It's standard node stuff, i just use cordova to build it after. If i can get it working in node, I can get it working in cordova
[20:41:20] <tristan1990> cool. already have that installed
[20:41:29] <rkgarcia> in your node app "var MongoClient = require('mongodb').MongoClient;"
[20:46:32] <tristan1990> ace. I'll start with that. Thank you very much rkgarcia ;)
[20:46:48] <rkgarcia> mongoose adds some features as validations, schemas, etc etc :)
[20:47:01] <rkgarcia> tristan1990: you are welcome
[20:47:59] <tristan1990> Okay, just checking. Using node-mongodb-native is it possible to have a search bar? (I realise that may be a ridiculous question)
[21:04:28] <tristan1990> Okay, so this is the queries.js example in the examples folder of the git I have cloned and done npm install in the same folder of
[21:38:39] <betty> rkgarcia: yea, I know about stats() function, I was wondering if for planning purposes I might estimate what the indexSize will be before creating them. I'm the planning stages of a project and need a rough idea of initial storage needs and cost
[23:45:44] <niftylettuce_> hey guys im trying to some advanced query, wondering if you can help ... http://stackoverflow.com/a/11418489 basically this but instead of having to do docs.filter I want to just do something like `.where({ tags: { $ne: null }) ... so it filters out anything that doesn't have tags populated