[00:21:51] <VarunVijayarghav> Had a question regarding MMS. I just finished setting it up for our mongo hosts. There is a column called "Cluster" which is not getting filled. Presumably, there is an option somewhere in my configuration that I am not setting up?
[00:21:51] <VarunVijayarghav> Just curious to know what that is.
[01:09:06] <caitp_> question: could I use $explain to provide insight into everything $pull is doing?
[01:09:33] <caitp_> and if so, what would that look like?
[01:10:05] <caitp_> would just db.collections.update({{}, {$pull: {…}}}).explain() be enough?
[01:22:38] <meLon_> Any benefit from indexing on 0,1,2,3 for a value vs a single char, such as I,F,T,P ?
[01:28:44] <caitp_> ignore my question, I got it to work
[13:10:04] <remonvv> Hm, both sides can be argued. The "well don't do anything stupid" argument has some merit. On the other hand, who would possibly want to break their cluster that way on purpose?
[13:41:44] <pithagorians> hey guys, i have a 3 members replica set. i kill the mongod process to test the failover and when i start it back mongo creates about 25 files of 2 GB each
[13:41:56] <pithagorians> are they kind of snapshot in time?
[13:43:18] <remonvv> I would assume it's pre-alloc for your data.
[13:43:38] <quattr8> I have a collection of user sessions which i want to shard, every user gets a http cookie with the documents mongoid and websiteid, everytime this document is retrieved with the _id and the websiteid, should i set a shardkey on _id and websiteid?
[13:45:02] <remonvv> why do you need more than _id? it's unique.
[13:46:38] <remonvv> It's rather like wanting to mail something to Petey and Petey says "I live at this address and also I like jeans"
[13:53:55] <quattr8> I build a simple adserver for my site and the tracking is now done by a seperate attribute trackingid and websiteid but the collection is getting a bit too large (88 million documents)
[13:54:17] <quattr8> then i thought i could just use the _id as trackingid and save a lot of space
[13:54:49] <remonvv> quattr8: What I am saying is this; if all documents are in one collection an _id value will ALWAYS uniquely identify any document in that collection. You say you have the _id value at lookup time which means you do not have to query on or put an index on "websiteId"
[14:04:22] <remonvv> pithagorians: local is where the oplog is, so makes sense that that is created. Why it's pre-alloced to 50Gb I'm not sure though. Is that the size of your dataset roughly?
[14:04:34] <pl2> /msg nickserv set password NodexHasAnUglyGirlfriend
[14:06:01] <pl2> ok now that I changed my password!! ;) I was wondering why my databases are being capped at 0.5GB? I'm on a 32bit install, but my first database stopped taking inserts at 2.5gb, now every other database maxes out at 0.5? What's going on here?
[14:06:50] <Nodex> db's are capped at 2gb on 32bit, are you sure it's 2.5?
[14:07:27] <remonvv> pl2; never use 32-bit anything
[14:08:35] <pl2> My host is 32-bit unfortunately :'(
[14:08:58] <remonvv> pl2: I'd advise against MongoDB then if that's not changing. Having a hard limit on DB size is too risky.
[14:09:30] <remonvv> pl2: It's a consequence of the storage engine being implemented on top of mmapped files. Other DBs do not have that limitation usually.
[14:09:59] <pl2> remonvv, yeah, it's been a bit problematic
[14:18:56] <Nodex> holy cow, they don't care about their website why should they care about thier servers
[14:20:53] <pl2> One thing I still don't get about the size issue.. if there's a 2gb limit, why is it that the databases are now being capped at 0.5gb?
[14:27:24] <Nodex> you just said you want to query on the entire array
[14:27:24] <pl2> Nodex, yeah it's strange, the first db went to: 2.5gb, the next two > 0.5gb and now another one I just tried stopped at > 0.25gb. I think mongo is trying to tell me something..
[14:27:48] <LoneSoldier728> Ok let me explain the situation im in
[14:28:19] <LoneSoldier728> I am querying a user's id that is stored in the cookie, so I want to find the person's signed in array for friendRequest
[14:28:37] <LoneSoldier728> I want to grab all there friend requests and then display it on their notifications page
[14:28:47] <LoneSoldier728> so I have this code so far
[14:28:54] <E1ven> Is there any place that old versions of the manual (2.0 or 1.8) are posted?
[14:29:22] <LoneSoldier728> but notifications is incorrect as it does not query
[14:29:42] <Nodex> LoneSoldier728 : you will have to post things in Mongodb shell language, I don't know what language that is you're using so I don't know how to read it
[14:48:53] <Nodex> var friends = [ObjectId("..."), ObjectId("...")....]; db.users.find({_id:{$in:friends}});
[14:50:12] <LoneSoldier728> so I have to stick to first querying just the user logged in then loop through the notifications.receivedRequest array
[14:50:32] <LoneSoldier728> then after the loop, loop through each user in the array
[14:50:38] <Nodex> but you will; have to make friends by looping the friendRequest array from the user's original document... (psuedo) foreach(friendRequests as i) { friends.push(i.friendId)}
[15:16:01] <LoneSoldier728> basically I am looping through the notifications array, and for each id [i] I am calling the receivedRequest that is nested in notifications then I am querying it by Id that is being given back to me and storing that in userX then pushing userX to the usersRequest array
[15:16:29] <Nodex> why are you querying them - it's a waste of time
[15:16:42] <Nodex> just add the id to an array and use $in at the end
[15:17:04] <Nodex> MilosStanic : can you var_dump($haystack)
[15:33:11] <LoneSoldier728> let me update the pastebin
[15:33:12] <xenophon> I am trying to use pulp, which a program that manages package repositories, and uses mongodb as a backend. However, it has been causing mongodb to segfault. https://bugzilla.redhat.com/show_bug.cgi?id=986070 http://pastebin.com/VgfHZj0q (the file just contains "db.queued_calls.drop();" ). The second link in particular seems to point the finger at mongo
[15:33:27] <Nodex> can you console.log the array and pasatebin the output
[15:38:32] <Nodex> MilosStanic : I don't understand it sorry
[15:38:48] <LoneSoldier728> http://pastebin.com/cESEyU2N it works now
[15:39:13] <Nodex> LoneSoldier728 : QUery 1... get your USER who logged in and loop his notifications array to build a list of USERS to query by _id using $in
[15:39:29] <LoneSoldier728> but is it bad the way I am querying the signed in user and throwing the friendRequest list into an array then querying each id in the array and throwing their whole docs in the another array
[15:39:30] <Nodex> Query 2. Execute the ABOVE query on $in and loop those results
[16:18:07] <OliverJAsh> i'm using MongoDB in my node application, and i need to write a function that manipulates data when it is received from the database. however, i'm not sure how to design the interface of the function – to receive one object (collection#findOne) or an array of objects (collection#find).
[16:18:56] <OliverJAsh> if i design it to work with arrays, then it will be optimised for that. however if i design it for just receiving an object, it won't be optimized. so, when i do call it with an array, this work it has to do will be slower.
[16:19:14] <rspijker> OliverJAsh: find does not return an array
[16:19:30] <rspijker> it returns a cursor over the results
[16:19:48] <OliverJAsh> the JavaScript adapter i'm using does (it has to i guess)
[16:32:24] <LoneSoldier728> the unset should just be removing the 1 id array and not all the id's in this query right?
[16:39:20] <dougb> if I'm doing a search that looks in field1, field2 and field3. Do I need to index these fields individually and create a combined index with all fields, or just create a combined index with all fields?
[16:39:53] <rspijker> for that search you would just need a compound index
[16:40:46] <dougb> rspijker: ok, so if I have 3 different types of searches, it's more efficient to create 3 compound indexes?
[16:41:16] <rspijker> this all very strongly depends on the scenario dougb
[16:46:38] <dougb> i would think compound indexes would be more efficient, i heard that having too many indexes can slow things down so I don't want to index fields individually when most of my searches require more than one field
[16:47:05] <rspijker> dougb: ordering is important though...
[16:47:23] <rspijker> a compound index on fields a,b and c (in that order
[16:47:32] <rspijker> won't do anything for a query on b and c
[16:48:03] <dougb> yes, i understand, so what I'm planning on doing is setting up two, one for a, b and c and one for b and c
[16:49:17] <rspijker> setting up a lot of indices is really only a problem when you start hitting RAM limits
[16:49:58] <rspijker> there are some tools as well which can analyse your query behaviour and make index recommendations based on that
[16:50:13] <rspijker> dex for instance: http://blog.mongolab.com/2012/06/introducing-dex-the-index-bot/
[18:12:18] <DanWilson> read this : Note Do not use mongoimport and mongoexport for full-scale backups because they may not reliably capture data type information. Use mongodump and mongorestore as described in “Backup Strategies for MongoDB Systems” for this kind of functionality.
[18:58:26] <xenophon> I am trying to use pulp, which a program that manages package repositories, and uses mongodb as a backend. However, it has been causing mongodb to segfault. https://bugzilla.redhat.com/show_bug.cgi?id=986070 http://pastebin.com/VgfHZj0q (the file just contains "db.queued_calls.drop();" ). The second link in particular seems to point the finger at mongo
[20:11:41] <xenophon> I am trying to use pulp, which a program that manages package repositories, and uses mongodb as a backend. However, it has been causing mongodb to segfault. https://bugzilla.redhat.com/show_bug.cgi?id=986070 http://pastebin.com/VgfHZj0q (the file just contains "db.queued_calls.drop();" ). The second link in particular seems to point the finger at mongo
[20:15:19] <xenophon> here is the tail end of the mongodb.log, not burried in the bug report: http://pastebin.com/WMsnnTSs
[20:34:11] <LoneSoldier728> I think the solution to my problem is to just change the data type to an object and then nest subarrays in that object
[21:38:40] <bjori> czajkowski: anything I can help you with?
[21:41:06] <czajkowski> bjori: ah it's ok I can ping in the morning cheers
[21:58:13] <caitp> okay, I'm not quite sure how to write this query (this seems to happen a lot): I can write a date filter fairly simply, but occasionally I need to filter not by a complete date, but only by the time portion of it
[21:58:25] <caitp> and I'm not sure how that would look
[22:00:17] <LoneSoldier728> Damn cannot get this to work still
[22:00:41] <LoneSoldier728> Anyone know how to remove an array nested down one
[22:01:31] <caitp> $pull maybe, but i'm not sure i parsed the question correctly
[22:18:23] <caitp> hmm, so almost 400 bytes per record just storing dates, if I were to do it that way
[22:18:45] <caitp> but maybe that's not such a big deal
[22:18:45] <xenophon> I am trying to use pulp, which a program that manages package repositories, and uses mongodb as a backend. However, it has been causing mongodb to segfault. https://bugzilla.redhat.com/show_bug.cgi?id=986070 http://pastebin.com/VgfHZj0q (the file just contains "db.queued_calls.drop();" ). The second link in particular seems to point the finger at mongo
[22:18:47] <xenophon> here is the tail end of the mongodb.log, not burried in the bug report: http://pastebin.com/WMsnnTSs
[22:19:53] <xenophon> I want to emphasise that API access is causing mongodb to SEGFAULT
[22:27:21] <caitp> mongo folks: does that even make sense? for a web app running on cheap cloud hosting, could I get away with storing 256 bytes of dates just so that I could index searches on the time components?
[22:27:48] <caitp> I am not really sure what my disk/memory constraints are, but I can't imagine they're very big
[22:36:03] <caitp> I need to occasionally query for documents where a time value fits within a given range (eg, any date between the hours of 6 and 12)
[22:36:40] <caitp> I'm not sure how I could do that efficiently without having an auxilliary field containing only the date component
[22:38:21] <caitp> but, if there is an efficient way to do that without special "please don't overwrite without permission" fields, then I'd love to hear about it
[22:48:38] <caitp> if you're talking about friendship in like a social media sort of way, would it not make sense to have an array of subdocuments per user, with the identities of their friends, and maybe some other values too?
[22:49:33] <cheeser> hrm. did that last bit about a marathon post here, too? my client is being a bit wonky.
[22:52:07] <Argorok> Hello. Im new to MongoDB and NoSQL databases... When I upsert a document, there's a way to work with "PREVIOUS VALUES" and "NEW VALUES" like I do in TRIGGERS on other databases? For example: I have a field called: times updated... I want to everytime that I update this field, set this field to FIELD VALUE + 1
[22:58:02] <LoneSoldier728> side note, how do I set a collection to a mongoose schema? I have no idea where the first one is being created from
[22:58:13] <LoneSoldier728> and for some reason it uses the users collection
[22:59:50] <caitp> you mean how do you set a schema to a particular collection?
[23:00:03] <maslowbeer> hello. having issues with my mongo cluster config and php. When i get the exception Fatal error: Uncaught exception 'MongoCursorException' with message '10.176.97.204:27017: not master and slaveOk=false' - is that a mongo server config issue (slaveOK) or something in the php connection/string/driver that is having the issue?
[23:00:04] <caitp> you can do it with a parameter of the Schema constructor