PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 21st of June, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:03:26] <jude0_> yes
[00:08:53] <jude0_> i just figure if you can query for the list of databases, you probably should be able to get the list of collections per db. has anyone figure out how/if you can do that?
[00:09:29] <jude0_> (with rest)
[00:19:36] <paulkon> jude0_: something along the lines of db.getCollectionNames() within the shell
[00:19:44] <paulkon> not sure what the REST equivalent for that is
[00:48:46] <MorehouseJ09> Having trouble with mongoose.js on node
[00:49:16] <MorehouseJ09> trying to right a test that replaces an instance method on all of a models instances
[00:49:20] <thesheff17> does anyone compile mongodb scons with distcc?
[00:49:21] <MorehouseJ09> anyone tried this
[00:52:28] <MorehouseJ09> aving trouble with mongoos.js
[00:52:37] <MorehouseJ09> anyone tried replacing an instance method on a Model object?
[01:07:48] <MorehouseJ09> tried doing something like Mongooseinstance.schema.methods.test = ()
[01:07:59] <MorehouseJ09> and no bueno, can't seem to replace the instance method on an object with mongoose
[04:23:38] <jon_r> can anyone lend a hand with a geo query?
[07:53:43] <jrichardson_> i install mongodb in debian. how can i configure mongo to use shard with mongodb.conf? I know how to configure using command line, but can't figure out how to configure shard with mongodb.conf
[07:54:30] <jrichardson_> which is preferred as described in http://docs.mongodb.org/manual/reference/configuration-options/
[08:10:02] <manjush> Can anyone tell me what a logical data independence means(mention my name: and reply if you want to answer)
[08:32:08] <sinisa> hi all, im stuck with sorting in aggregation .. if someone can help
[08:32:40] <kali> manjush: i've observed you on various channel for a few days, and frankly, you need to learn when to use irc, and when to use google and wikipedia :)
[08:32:57] <kali> sinisa: and you need to ask real question, not rethorical ones :)
[08:33:30] <sinisa> i know i know.. :)
[08:34:28] <sinisa> $group: {_id: "$_id", docs:{$addToSet: "$doc"}}.. how to sort on docs
[08:35:24] <sinisa> doc:{field1:"$field1"} ... thats doc in project
[08:35:51] <sinisa> have to sort on doc.field1 after grouping
[08:36:33] <kali> you need to sort internally the "docs" array ?
[08:36:40] <sinisa> yes
[08:36:45] <kali> and i don't think you can do that
[08:36:55] <sinisa> no?
[08:37:44] <kali> you can try this approach
[08:37:45] <kali> http://stackoverflow.com/questions/15388127/mongodb-sort-inner-array
[08:37:58] <jrichardson_> is it possible to configure mongodb shard with debian package (which makes use of mongodb.conf)?
[08:38:07] <kali> sorting *before* building the array
[08:39:32] <sinisa> dont know is that possible .. im grouping , after grouping i have like group1:[doc1,doc5,doc22] .
[08:40:22] <manjush> kali: Things get difficult when you are in places like India
[08:41:08] <manjush> I know when to use irc but the thing is my internet speed which is 1.5 g not even 2g
[08:41:31] <sinisa> like for example.. cars {name:"ford",group:"sport"}{name:"honda",group:"coupe"}... im grouping on "group", and after that have to sort it by name in each group
[08:41:59] <sinisa> group, sort, unwind , sort ?
[08:46:33] <kali> sinisa: sort by name, then group with $push, then sort the group ?
[08:47:29] <sinisa> sort before group ...
[08:48:18] <sinisa> but after group everything goes messy .. isnt it :)
[11:52:45] <spicewiesel> I set up my replicaset and configservers, everything is up now, but auth fails if I try to connect to my mongos, on mongod instances my credentials are accepted. What did I wrong?
[12:38:45] <pwned> spicewiesel: did you bind them to their ips or just lolcalhost?
[12:39:25] <spicewiesel> pwned: to full hostnames, but I think I missed a thin, I did not add the shards, so I think there is no connection between configservers and replicaset atm.
[12:43:35] <spicewiesel> *I bound them on their ips and localhost, and tried to connect via hostnames :)
[12:54:41] <mUniKeS> hi
[12:54:48] <mUniKeS> I have a question
[12:55:00] <mUniKeS> First of all, sorry for my english
[12:55:11] <mUniKeS> I've been searching the internet for days, and doing tests, but nothing
[12:55:20] <mUniKeS> when I doing: Object.bsonsize(db.collection.findOne({'x':'y'})), for caculate the size of a document
[12:55:28] <mUniKeS> and when I doing: db.collection.stats(), in a collection with only one document
[12:55:37] <mUniKeS> the fist sentence give me 3 bytes minor than the second, why?
[12:55:44] <mUniKeS> thanks, and sorry for the inconvenience
[13:16:00] <starfly> mUniKeS: it usually works best if you use paste.org to save what you're referring to (and post the link to that here)
[13:16:08] <starfly> *pastie.org
[13:16:59] <mUniKeS> ok thanks, startfly
[13:39:59] <kobigurk> I have a question about the C# driver - I want a query using the positional operator $, when editing an array inside a document. I can use it when I specify the name of the field in a string, let's say "array.$", but I want to use the Generic version. I couldn't find an equivalent - is there?
[14:05:05] <thesheff17> anyone compile mongodb scons with distcc? no matter what I do it seems to not pick up my settings for this.
[14:41:16] <as001> hey all
[14:41:35] <as001> I am attempting to use a dbobject to insert a record into a collection
[14:42:03] <as001> how as a dbobject can I tell it what collection to insert the object into in one line
[14:42:11] <kali> sounds like a good start... what language ? :)
[14:42:44] <as001> I know I can do this
[14:42:45] <as001> { "$oid" : "61c378db086c348a8753e6d6"} , "value" : "SampleTest" , "counter" : 5}
[14:43:29] <as001> but how do i tell it what collection to insert into as text . IE I want to use db.command(String value) to insert records
[14:43:54] <kali> what language ? java ?
[14:43:58] <as001> java
[14:44:29] <kali> you're supposed to use Collection.save(), not DB.command for that
[14:45:09] <kali> also, you'd better use DBObject than the json string hacks
[14:45:23] <as001> yup. but I am trying to do something a little different. IE before running a unit test run all commands in a file parse each to a dbobject and run a db.command()
[14:45:43] <as001> is something like that possible for setup for unit tests
[14:45:43] <kali> i'm not sure you can insert with a command
[14:45:58] <as001> is there a way to say switch to collection
[14:46:00] <kali> command are kinda "meta" stuff
[14:46:29] <kali> i don't understand what you mean
[14:47:17] <as001> so i am trying to do unit tests for my repo layer
[14:47:21] <kobigurk> I have a question about the C# driver - I want a query using the positional operator $, when editing an array inside a document. I can use it when I specify the name of the field in a string, let's say "array.$", but I want to use the Generic version. I couldn't find an equivalent - is there?
[14:47:46] <as001> I want to say setup the embedded database by executing commands file
[14:47:53] <as001> and then run the unit test
[14:48:18] <as001> so when mongo does a insert how does it know what collection it is inserting into?
[14:48:32] <as001> if its not defined
[14:48:55] <as001> I am assuming that some how it wrapps it or set the collection first
[14:49:37] <kali> as001: maybe you can write the fixtures files in javascript and run it through a eval()
[14:50:50] <as001> sounds like it could work
[14:51:04] <as001> any link to using the eval
[14:51:42] <kali> http://docs.mongodb.org/manual/reference/command/eval/#dbcmd.eval
[16:59:56] <dandre> hello
[17:00:30] <dandre> when I insert a document in a collection, how can I get the new _id?
[18:19:38] <redfox_> Hi. I want to fetch all comments (subdocuments) from a post (root document) whose attribute "unlocked" is true. I dont want to fetch comments/subdocuments which have "unlocked" set to false. Can i achieve this with a single query?
[18:38:35] <astro73|roam> redfox_: check the find() parameters, specifically how they handle lists, and the $ projection operator
[19:22:50] <jegade> hi, i run into this error, once per day http://pastie.org/8067414
[19:23:58] <jegade> mongod[27323] trap int3 ip:7f4a00fd8da1 sp:7f49f3111600 error:0
[19:29:59] <crudson> is there a server-side error?
[19:31:32] <jegade> crudson: what do you mean?
[19:39:06] <crudson> sorry I glanced and thought it was a client error. Can you identify what operation is causing this? I expect there is an application trace too somewhere or a record of the command.
[20:06:42] <cedrichurst> hi all, what's the best way of calling $addToSet on a multi update?
[20:07:51] <cedrichurst> db.myCollection.update({q: 5}, {$addToSet: "foo"}, {multi: true}) doesn't appear to do what i was hoping it would do
[20:14:40] <cedrichurst> sorry, this is the exact query i'm running...
[20:14:46] <cedrichurst> db.foo.update({q: ObjectId("51c4b1b42882f3b37d20146c")}, {$addToSet: {foo: "foo"}}, {multi: true})
[20:14:51] <cedrichurst> so that works in mongo-cli
[20:15:13] <cedrichurst> but when i try collection.updateMulti from the java driver, the addToSet is not acknowledged
[20:37:20] <cedrichurst> figured that one out, but now i have another issue… let's say i have a doc as {foo: ["bar", "buzz"]}. how do i query for all docs not containing "buzz" in its `foo` array?
[20:37:42] <cedrichurst> {foo: {$not: "buzz"}} doesn't appear to be doing what i expect
[20:38:36] <crudson> $ne
[20:40:26] <cedrichurst> ne doesn't appear to be doing what i expect either
[20:40:30] <cedrichurst> see the following example: https://gist.github.com/divideby0/4c73e52c5b48fff2b731
[20:40:48] <cedrichurst> i'd expect that to be a contradiction producing 0 results
[20:43:00] <crudson> you need to use $elemMatch there
[20:43:24] <crudson> http://docs.mongodb.org/manual/reference/operator/elemMatch/
[20:44:38] <cedrichurst> so would it be {$ne: {$elemMatch: ...
[20:44:52] <crudson> I think - let me look more, was writing some code
[20:45:02] <crudson> don't want to send you down the wrong path.
[20:45:09] <cedrichurst> sorry to bug you, i can try a few options on elemMatch
[20:45:14] <cedrichurst> thanks
[20:48:16] <crudson> ok what are you trying to do - you have the same id in both parts..?
[20:48:57] <cedrichurst> i'm trying to find all documents in the ideal collection that do not have ObjectId("51c4b1b42882f3b37d2013e9") anywhere in their `o` field
[20:49:55] <cedrichurst> the $elemMatch example provides an example for something like {o: [{bar: "buzz"}]}
[20:50:23] <cedrichurst> but when i do `db.ideal.find({o: {$not: {$elemMatch: ObjectId("51c4b1b42882f3b37d2013e9")}}})` i get a `error: { "$err" : "$elemMatch needs an Object", "code" : 12517 }`
[20:50:36] <crudson> right, I thought you were doing something else, sorry
[20:51:19] <crudson> just {$ne: new ObjectId("51c4b1b42882f3b37d2013e9")}
[20:52:11] <cedrichurst> but that seems to return an object that should be filtered per my gist
[20:52:54] <cedrichurst> when i have {"o" : [ObjectId("51c4b1b42882f3b37d2013e9"), ObjectId("51c4b1b42882f3b37d2013ea"), ObjectId("51c4b1b42882f3b37d2013eb")]} for example
[20:53:25] <cedrichurst> ObjectId("51c4b1b42882f3b37d2013ea") is not equal to ObjectId("51c4b1b42882f3b37d2013e9") so the object is still getting returned
[20:54:16] <crudson> your gist has the same ID in both parts, which just effectively cancel each other out
[20:54:47] <cedrichurst> i thought the commas product a boolean AND?
[20:55:34] <cedrichurst> db.ideal.find({foo: "bar", buzz: "bang"}) should only return {foo: "bar", buzz: "bang"} and not {foo: "blah", buzz: "bang"}
[20:56:00] <cedrichurst> *product=produce
[20:57:52] <crudson> if querying the SAME field many times, you need to use $and
[21:14:14] <johnkpaul> is there a command that can tell me what db I'm currently connected to
[21:14:19] <johnkpaul> I know tht I use somethind; a while ago
[21:15:28] <harenson> johnkpaul: db
[21:15:36] <harenson> and press enter *
[21:15:37] <johnkpaul> I mean I want to know the name
[21:16:01] <harenson> johnkpaul: write 'db', then, enter
[21:16:06] <johnkpaul> ah ok
[21:17:07] <crudson> johnkpaul: which is db.getName() - type db<tab><tab> to see completions if you ever forget a command
[21:17:25] <crudson> don't forget . after db
[21:17:26] <johnkpaul> crudson: harenson ah awesome, thank you!
[21:17:46] <harenson> johnkpaul: your welcome
[21:20:30] <cedrichurst> crudson, thanks!
[21:20:41] <cedrichurst> that was it, i was seeing false negatives with that logic
[21:21:04] <crudson> cedrichurst: excellent. http://docs.mongodb.org/manual/reference/operator/and/ - there is a note near the bottom.
[21:21:26] <crudson> I had to play about, as this is implicit behavior
[21:21:27] <cedrichurst> thank you again
[21:25:50] <crudson> anytime
[21:40:07] <harenson> johnkpaul: your welcome