PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 10th of November, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:58:36] <Aquilas> Hey guys can I just query the mongodb and just generate a random ObjectID that does not exist?
[02:58:48] <cheeser> huh?
[02:59:01] <Aquilas> I just want a random ObjectID
[02:59:17] <cheeser> new ObjectID()
[02:59:47] <Aquilas> Oh. Does the C++ driver have that ass well. For example: conn.ObjectID()
[02:59:49] <Aquilas> as*
[03:00:06] <cheeser> i would expect so
[03:00:12] <cheeser> something like that.
[03:00:29] <Aquilas> I shall try then
[03:03:31] <Aquilas> dang does not seem to exist
[03:05:36] <Aquilas> nvm it does
[04:24:32] <robertjpayne> Does mongodb have any injection concerns when it comes to the find() call?
[04:29:16] <cheeser> http://docs.mongodb.org/manual/faq/developers/#how-does-mongodb-address-sql-or-query-injection
[04:42:22] <robertjpayne> thanks
[04:43:21] <zivester> is ther a way to do a db repair (to reclaim space) my using another mount?
[07:21:02] <Gambit-> Hi folks - I'd like to hear some first-hand details on how much throughput a fully tapped out replication task is likely to push using some easily-describable instance type, be it on EC2 or elsewhere.
[07:21:07] <Gambit-> Does anyone have some numbers they can throw at me?
[07:21:22] <Gambit-> Mostly trying to get order-of-magnitude measurements, this obviously isn't a scientific request :)
[08:52:28] <justanotherday> novice needs help with #mongodb
[08:53:08] <jkitchen> this isn't twitter. # isn't for hashtags, it's just part of the channel name
[08:54:19] <justanotherday> oh thanks
[08:55:27] <jkitchen> # channels differentiate from & channels in that # channels are global to the network and & are local to the server. since the irc protocol command to send a message to a channel and to a user are the same thing (PRIVMSG), it provides a namespace
[08:55:53] <jkitchen> I've been on IRC too long :(
[08:57:32] <justanotherday> :-)
[08:58:58] <justanotherday> maybe you should go to the kitchen
[09:01:07] <jkitchen> you said you needed help?
[09:04:25] <justanotherday> Yes I do
[09:05:02] <justanotherday> Looking at mongodb for the first time, have a task to do in it and I am totally lost
[09:28:21] <justanotherday> jkitchen, where did u go?
[09:28:30] <jkitchen> justanotherday: I'm here
[09:29:07] <justanotherday> can u help a sister out?
[09:29:31] <jkitchen> you haven't asked any questions
[09:31:00] <justanotherday> sorry, really a newbie
[09:31:34] <kjelle> hello.
[09:31:42] <justanotherday> i have a file I am supposed to insert into mongodb and perform queries on
[09:31:53] <kjelle> could anyone recommend a nice MongoDB JSON editor (preferabely on web) tool? E.g. is robomongo nice?
[09:32:48] <justanotherday> i have issues importing the files, dont even know exactly what to do, I installed mongodb and have it running, but that the best I could do
[09:33:13] <jkitchen> justanotherday: what sorts of files?
[09:33:36] <justanotherday> I am doing a project for bioinformatics and I am supposed to find out if mongodb is better to use than the sql we usually use
[09:33:38] <jkitchen> justanotherday: also, you may want to take a look at http://docs.mongodb.org/manual/tutorial/getting-started/
[09:34:21] <jkitchen> kjelle: vim? :)
[09:34:36] <joannac_> justanotherday: MongoDB also has free online courses that take you through some of the basics, https://education.mongodb.com/
[09:34:53] <justanotherday> yea I did, dont really have the computing background, I study bio, but we work with sql and I am supposed to do this now
[09:34:59] <justanotherday> oh ok
[09:36:25] <jkitchen> kjelle: well, robomongo isn't a signed app on OSX so that's one strike against it :)
[09:38:55] <justanotherday> what directory do i need the file to be in to maybe run the import command
[09:39:04] <justanotherday> $ mongoimport -d mydb -c things --type tsv --file refgenetable.csv --headerline
[09:39:45] <joannac_> whatever directory you run that command in?
[09:39:58] <jkitchen> justanotherday: --file specifies the path. in that case it's relative to the current directory
[09:40:00] <kjelle> jkitchen: hehe ok
[09:40:14] <kjelle> we'r gonna store intel in a db.
[09:40:21] <kjelle> but we dont want a complex solution.
[09:40:30] <kjelle> i figured a mongodb cluster with some easy gui would be very nice.
[09:40:45] <jkitchen> gui.
[09:40:52] <kjelle> yes, and i dont want to make gui.
[09:40:56] <kjelle> coding gui is nasty :)
[09:41:37] <justanotherday> jkitchen, i have no idea what you meant
[09:41:58] <jkitchen> that does look like a neat tool though. a nice hybrid of command line and gui. I could get used to that sort of thing.
[09:42:55] <jkitchen> justanotherday: the file should go in the directory where you ran the command
[09:43:25] <justanotherday> oh it worked, seems its importing
[09:43:26] <justanotherday> :-p
[09:43:33] <jkitchen> awesome
[09:43:54] <justanotherday> Yea I guess so, I put it in the db folder
[09:44:17] <jkitchen> while it goes: watch this and you'll understand what I meant: https://www.youtube.com/watch?v=M3JirqAPg9g
[09:47:51] <kjelle> well
[09:47:56] <kjelle> robomongo seems nice it seems.
[09:48:05] <justanotherday> thanks
[09:53:34] <justanotherday> Not working :-(
[09:54:14] <justanotherday> can I paste and show you?
[09:54:27] <joannac_> pastebin
[09:55:04] <justanotherday> mongoimport -d mydb -c things --type tsv --file refgeneTable.txt --headerline connected to: 127.0.0.1 Sun Nov 10 01:41:54.009 Progress: 1622533/2920849 55% Sun Nov 10 01:41:54.010 25700 8566/second Sun Nov 10 01:41:56.144 check 9 46159 Sun Nov 10 01:41:57.361 imported 46158 objects
[09:55:43] <justanotherday> but when I try :: db.mydb.find() it returns nothing
[09:56:01] <jkitchen> justanotherday: db.things.find()
[09:56:12] <justanotherday> omg
[09:56:18] <justanotherday> silly me
[09:56:26] <justanotherday> thanks
[09:56:38] <jkitchen> yup
[09:56:51] <justanotherday> It works :-*
[10:01:25] <floatingpoint> what does the find() method return if no documents are matched?
[10:01:28] <floatingpoint> null?
[10:01:29] <floatingpoint> NULL?
[10:01:51] <jkitchen> undefined, I would think
[10:02:01] <jkitchen> javascript, and such.
[10:02:04] <floatingpoint> think or know?
[10:02:24] <jkitchen> would take like 2 seconds to find out on your own :)
[10:03:28] <kjelle> http://docs.mongodb.org/ecosystem/tools/administration-interfaces/ <- I see there is a long list :)
[10:05:03] <justanotherday> jkitchen thanks, I really should use my brain more often
[10:05:16] <floatingpoint> would the count method be more efficient than find?
[10:16:59] <robertjpayne> floatingpoint: easiest way would be to just do it.. and measure performance
[10:17:14] <floatingpoint> in other words, you don't know!
[10:18:04] <robertjpayne> floatingpoint: A count is probably a better idea because you wont have poor performance if the results are > 0
[10:18:12] <liquid-silence> how does one count items in a sub array?
[10:18:23] <floatingpoint> yes, I aagree
[10:18:50] <liquid-silence> db.books.find({ "pages._id": "527f44640000002651000004"}, {"pages.$.words":1}).count()
[10:18:59] <floatingpoint> additioanlly, it appears possible to make the method stop if 1 is returned
[10:19:05] <liquid-silence> I want to only return the count of words
[10:19:09] <floatingpoint> rather, if 1 matching document is found
[10:19:10] <liquid-silence> that is however a bad example
[10:21:09] <liquid-silence> anyone?
[10:52:52] <kali> liquid-silence: http://docs.mongodb.org/manual/reference/operator/query/size/
[10:53:36] <liquid-silence> kali I am not sure that will work
[10:55:55] <liquid-silence> kali that will not work as its nested quite deep
[10:56:08] <liquid-silence> so I need to do find({...}, { projection }
[10:56:49] <kali> aggregation framework should be able to do it
[10:57:07] <kali> but if it is an important query for your app, you probably want to get the count as a separate field
[10:57:13] <liquid-silence> yeah never did that before
[10:57:24] <liquid-silence> I only want the count
[10:57:26] <liquid-silence> nothing more
[10:57:49] <kali> it gives you a chance to learn :P
[10:58:32] <liquid-silence> yeah learned so much mongo
[10:58:36] <liquid-silence> in the past week
[10:59:39] <ron> kali: dude, it's the weekend for you.
[11:01:26] <liquid-silence> kali
[11:02:06] <liquid-silence> I just want to count the comments
[11:02:07] <liquid-silence> lol
[11:17:07] <kali> ron: yeah, long week-end
[11:17:16] <liquid-silence> kali even with messing with unwinds
[11:17:17] <ron> kali: go home!
[11:17:18] <liquid-silence> I get no results
[11:19:01] <kali> i'm home :)
[11:19:25] <ron> so stop working!
[11:20:01] <kali> liquid-silence: $unwind your comments, then $group them again counting them at the same time
[11:20:15] <kali> ron: this is not work, it's sharing wisdom
[11:20:25] <liquid-silence> db.assets.aggregate({$unwind: "$assets"},
[11:20:26] <kali> ron: that's what sunday where meant to be for, right ?
[11:20:27] <liquid-silence> {$unwind: "$assets.annotations"},
[11:20:27] <liquid-silence> {$unwind: "$assets.annotations.comments"},
[11:20:27] <liquid-silence> {$match: { "assets.annotations._id": "527f44640000002651000004"}},
[11:20:27] <liquid-silence> {$project: { comments: "$assets.annotations.comments"}},
[11:20:27] <liquid-silence> )
[11:20:34] <liquid-silence> whoops though that was going to be on one line
[11:20:38] <ron> kali: you talk like you're a 75 year old man ;)
[11:20:38] <kali> liquid-silence: and use a dams pastebin
[11:20:54] <liquid-silence> kali I thought it was going to be one line
[11:20:56] <liquid-silence> sorry
[11:21:00] <kali> ron: that's how wise i am
[11:21:01] <ron> kali: well, for me sunday is the beginning of the week, so let's ignore that ;)
[11:21:43] <kali> ron: ok :)
[11:21:57] <ron> kali: aren't you supposed to go on the street and yell 'merde' at people or something like that?
[11:22:40] <kali> ron: na, that's weekdays
[11:22:56] <ron> heh
[11:24:28] <kali> ron: http://www.youtube.com/watch?v=A8yjNbcKkNY
[11:27:52] <ron> kali: thank you for that. definitely made me smile :) I fart in your general direction!
[11:29:04] <tomasso> i run the following query : db.stops.find( { 'loc' : { $near : { $geometry: { type: 'Point', coordinates: [-58.417016,-34.603585] } }, $maxDistance: 60000 } } ) in the mongo shell but i dont get any output.. even by calling pretty() .. neither an error.. the index was created by ensureIndex() and it gets listed in the db.. the stop collection exists.. :S
[11:29:46] <kali> tomasso: does count() return 0 ?
[11:30:29] <tomasso> kali: nope... returns 2035
[11:31:03] <kali> tomasso: dafuk ? cut and paste your shell session somewhere :)
[11:31:43] <tomasso> Ok xD
[11:33:44] <tomasso> xD nice place
[11:40:59] <tomasso> http://pastebin.com/Usa3tYH9
[11:42:10] <tomasso> should the GeoJSoN point be outer that other keyvalues in the json ? or it will find the desired loc key
[12:25:14] <liquid-silence> why cant it just do a count like in SQL
[12:25:15] <liquid-silence> lol
[12:53:04] <liquid-silence> kali still around?
[13:02:33] <liquid-silence> Can anyone see anything wrong with this query, db.assets.aggregate({$match: { "annotations._id": "527f44640000002651000004"}}, {$unwind: "$result.nnotations.comments"}, {$project: {count:{$add:1}}},{$group: {_id: null, number: {$sum: "$count" }}}), I am trying to get the count of the comments for an annotation
[13:03:04] <liquid-silence> sorry the query is actually db.assets.aggregate({$match: { "annotations._id": "527f44640000002651000004"}}, {$unwind: "$annotations.comments"}, {$project: {count:{$add:1}}},{$group: {_id: null, number: {$sum: "$count" }}})
[13:03:58] <liquid-silence> the sum part is incorrect
[14:34:52] <axyjo1> Hi all, I'm new to mongo and I'm having some trouble with the aggregate functionality. I'm trying to use a $geoWithin operator within a $match operator, but I can't seem to get it to work. My query is here: http://pastie.org/8469775 and I'm using Mongo 2.4.8
[14:36:49] <cheeser> and the error?
[14:36:51] <axyjo1> The error I get is errmsg: 'exception: Malformed geo query: { $geoWithin: { $box: [ [ "-80.54830849170685", "43.47190424797107" ], [ "-80.53974688053131", "43.47424390867122" ] ] } }',
[14:37:22] <axyjo1> I tried parseFloat/parseInt on the four numbers that go in (thinking that they were strings), but that didn't help
[14:37:54] <axyjo1> a similar clause worked fine for a .find operation
[14:42:39] <cheeser> yeah, it really looks like you're sending in strings there.
[14:43:24] <axyjo1> yeah, the quotes implied strings
[14:43:36] <axyjo1> but if I do a parseInt, the integers are quoted too
[14:44:05] <cheeser> what do you mean?
[14:44:57] <axyjo1> It'll give me the same error, but without the decimal part of the number.
[14:45:05] <axyjo1> (and the numbers are still quoted)
[14:46:06] <axyjo1> It's probably the client library. Thanks, cheeser!
[14:57:36] <cheeser> axyjo1: try taking the test from the error and running it directly in the shell.
[14:58:03] <axyjo1> Yep, if I copy it directly into the shell and remove quotes, it works like a charm!
[15:09:57] <zivester> if I add millions of documents to a collection, 10k at a time, and i purge documents whenever count is > 100k, will my db size remain consistent or will it keep growing?
[15:39:40] <garbagecollectio> does anyone know what mongo returns if after a find command it doesn't find anything
[15:39:41] <garbagecollectio> in php
[15:40:06] <ron> Nodex
[15:40:22] <ron> Derick
[17:38:35] <dnsdds> I'm having a hard time with setting up and using text search indexes; ensureIndex only works with a hardcoded object, not with a var that includes an object, and when I try to runCommand("text" ...), it says I have too many indexes
[20:33:36] <dnsdds> I'm having a hard time with setting up and using text search indexes; ensureIndex only works with a hardcoded object, not with a var that includes an object, and when I try to runCommand("text" ...), it says I have too many indexes. Anybody got any ideas?
[20:43:39] <joannac_> dnsdds: What do you mean by "hardcoded object" vs "var that includes an object"?
[20:44:53] <dnsdds> dnsdds: ensureIndex("text", { name: "text", tags: "text" }) works, but var obj = { name: "text", tags: "text" }; ensureIndex("text", obj); doesn't
[20:45:09] <dnsdds> Sorry, that's without the "text",
[20:45:34] <joannac_> ensureIndex(obj) ?
[20:45:44] <joannac_> what's obj?
[20:46:20] <dnsdds> obj being the var including the keys object, as included in the snippet
[20:46:25] <dnsdds> var obj = { name: "text", tags: "text" }; ensureIndex("text", obj);
[20:49:12] <joannac_> why do you have the extra "text" in there?
[20:49:34] <joannac_> ensureIndex(obj) works fine for me
[20:49:58] <dnsdds> Yeah, I just said, it was a mistake; ensureIndex({ name: "text", tags: "text" }) works, but var obj = { name: "text", tags: "text" }; ensureIndex(obj); doesn't
[20:50:09] <joannac_> Okay, and it works for me.
[20:50:17] <joannac_> What's the error you're getting?
[20:53:47] <dnsdds> joannac_: a later runCommand("text"...) comes out as undefined when I run it through the object
[20:55:38] <joannac_> Through which object?
[20:57:25] <dnsdds> When I do ensureIndex(obi) as before, runCommand("text" ...) comes out as undefined. When I do ensureIndex({ name: "text", tags: "text" }), runCommand("text" ...) comes out as "Too many indexes for collection"
[20:58:09] <joannac_> Okay, those are 2 separate errors.
[20:58:37] <joannac_> pastebin the output of system.indexes.find()
[21:00:48] <dnsdds> joannac_: http://pastebin.com/GTNiLwdP
[21:05:59] <joannac_> What collection are you running against
[21:07:08] <dnsdds> plusminus
[21:08:11] <joannac_> that's a database.
[21:08:19] <joannac_> you don't have a collection called plusminus
[21:09:01] <haiQt> Hi guys, I was wondering if someone could help me with a Mongoose question? I have Posts & Tags, and when I retrieve my posts the tags array inside of a post does not get populated
[21:10:06] <joannac_> dnsdds: sorry gtg afk now
[21:10:33] <dnsdds> joannac_: That's cool
[21:10:39] <dnsdds> Anyone else wanna take a crack?
[21:11:09] <haiQt> Scratch that, I just found the error :)
[21:53:31] <nullsign> mongomongomongo
[22:02:28] <bobbobbins> hey, is there something wrong with this? db.reportData.update({"Report_ID":"121"},{$set:{"Lot_No_2":"12345"}});
[22:02:36] <bobbobbins> it seems like it should work, but its not updating for me
[22:02:52] <bobbobbins> i definitely have a record with a Report_ID of 121
[22:07:30] <eydaimon> Derick: maybe you rememeber, but I asked a quesiton about dividing clients by prefixed collection, or one database per client. You said database per client, but told me to test. Which one do you think would be faster? Is there any mongodb architecture which would lead you to think that one's better insofar as performance than the other?
[22:10:19] <bobbobbins> i even tried by id and it still isn't updating
[22:35:50] <tomasso> i need to update a document whose key is variable and it is inside of an array.. like this "myvariablekey" : [{a : 1}, {a:2}, ... {x:4}] .. for some reason the update fails to use myvariablekey, it may contain special characters.. so I try to access that field by number, is that possible?
[23:29:41] <joannac_> bobbobbins: what's the output of db.reportData.find({"Report_ID":"121"})