PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 12th of July, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:17:01] <tystr> hmm
[01:17:02] <tystr> mongorestore ERROR: root directory must be a dump of a single database when specifying a db name with --db
[01:17:13] <tystr> I'm only dumping a single collection from a single database
[01:17:25] <tystr> but I'm still getting this error when trying to restore to another database
[01:27:56] <crudson> what was your mongodump command?
[01:29:08] <tystr> mongodump --db db_name --collection coll_name
[01:29:24] <crudson> did you specify --collection in mongorestore?
[01:30:02] <tystr> yup
[01:30:11] <tystr> tried it with and without the --collection option
[01:32:27] <crudson> give the file rather than the directory as argument
[01:32:44] <crudson> so dump/db/collection.bson
[01:33:40] <tystr> as the --collection option?
[01:33:54] <tystr> oh nvm
[01:34:09] <crudson> as the last argument to the command, e.g.: mongorestore -d db -c c dump/db/collection.bson
[01:34:24] <tystr> ok lemme try that
[01:35:00] <crudson> providing you let it output to the default 'dump/' directory
[01:35:10] <tystr> ahh yeah
[01:35:13] <tystr> that did the trick
[01:35:16] <crudson> cool beans
[01:35:21] <tystr> ty crudson :)
[01:35:24] <crudson> welcome
[01:35:27] <crudson> gl
[07:32:35] <[AD]Turbo> hola
[07:40:58] <fredix> hi
[07:41:19] <fredix> is it possible to update fields and use $inc in the same query ?
[07:41:52] <fredix> I need to modify some fields and increment one
[07:44:47] <wereHamster> {$set: {foo:bar}, $inc:{baz:1}}
[07:47:23] <fredix> wereHamster: ok thx !
[09:36:06] <Lujeni> Hello - Are there any best practises for delete many documents ( > millions ) ?
[09:43:01] <mids> Lujeni: if you want to delete all documents, it is faster to just drop the collection
[09:43:20] <mids> do you have a query for deleting them/
[09:43:23] <mids> ?
[09:43:54] <Lujeni> mids, yeah. query withdatetime
[09:44:20] <mids> just do it once, or is this a frequent job/
[09:45:40] <Lujeni> it will be a frequent job
[09:46:18] <mids> what percentage are you deleting?
[09:48:27] <idefine> I'm using the node-mongodb-native driver and had a question about performing an update on a collection inside of a cursor.each. Is it safe to do this? I keep running into problems.
[09:51:54] <Lujeni> mids, I dunno.
[09:54:22] <mids> Lujeni: how many documents are there in total, ballpark; is there an index on the datetime field?
[10:05:04] <idefine> i solved it by using toArray instead of each.
[10:05:24] <idefine> but i believe each should also work for that no?
[10:08:25] <Lujeni> mids, ~200millions. Yeah, i use _id default (objectid).
[10:09:24] <qpok> c# driver users, I have a bsonid field that is a property whose value is composed of of other properties. It has no setter. Do I need a custom serializer to be able to perisist & load it? or is there an easier way
[10:09:36] <qpok> *bsonid property that is
[10:09:42] <ron> of course there's an easier way.
[10:09:58] <qpok> cool. and may I hear it?
[10:10:22] <ron> of course! use a language that doesn't cost you money.
[10:10:23] <ron> :D
[10:11:39] <ron> Seriously though, I have no idea. sorry.
[10:12:24] <Derick> qdennisl: Add flights to the routing engine too? :-)
[10:13:31] <cynosure> lol
[10:13:36] <Derick> heh
[10:16:11] <qpok> okies AlwaysIgnoreExtraElementsConvention seems to work too.. yet it comes with other undesired effects. so a custom serializer it is :(
[11:09:53] <qpok> and ignore my previous ranting... neither custom serialization nor ignoring extra elements does the job. But a custom IMemberFinderConvention does
[11:13:25] <ron> nice. 10gen webinars have much better scheduling information now. nice.
[11:13:30] <ron> only one thing left to fix.
[13:27:23] <owen1> test
[13:38:57] <ron> owen1: you failed. you're a big, fat failure.
[15:03:43] <Honeyman> Hello. Can I retrieve only a subobject, which is a result of find lookup, rather than the whole top-level document, or all subobjects? http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields are unclear about it...
[15:04:49] <Honeyman> For example, if I have a collection of 'users' and each user has a sub-collection of "posts", and I am looking up to a specific post (say, by its title), how can I get only that post?
[15:05:36] <Lujeni> Hello - Use compact on single collection can increase performance or just larger objects might reuse it ?
[15:05:58] <Derick> Honeyman: you can not do that right now; filter it out in your application's model
[15:06:25] <Honeyman> Derick: uhm, a pity.
[15:06:43] <Honeyman> I hoped for $ symbol, but it seems it works in updates only.
[15:07:05] <Honeyman> But if it is a known lack of feature, is there any ticket on it to vote up?
[15:07:50] <Derick> hmm, not sure whether there is a tickt, sorry
[15:09:35] <ninja_p> hey guys, what kind of logs might we expect to see within a replicaSet when an election happens
[15:10:54] <ninja_p> is there a specific entry we should see?
[15:11:55] <Derick> ninja_p: something like this: http://pastebin.com/VN229DYf
[15:12:42] <ninja_p> Derick thats perfect, thank you
[15:15:40] <mids> Honeyman: https://jira.mongodb.org/browse/SERVER-828
[15:17:02] <namidark> mongo config server has the wrong hosts in it and the same is true for the mongos; how can I correct this? I fixed it in the repliation set and serverStatus shows the correct hosts on the replica set... but its not on the config/mongoS
[15:17:02] <Derick> oooh, that's in 2.1.2
[15:20:02] <ninja_p> Derick we get a lot of the following within the mongo log file, is this concerning?
[15:20:02] <ninja_p> Wed Jul 11 21:10:06 [conn17162] SocketException: remote: XXX.XX.XXX.134:58257 error: 9001 socket exception [0] server [XXX.XX.XXX.134:58257]
[15:20:29] <ninja_p> at the same point we often get a "Exception when retrieving mongo cursor results (19) [ couldn't send command ] "
[15:20:31] <Derick> it just means the connection broke/couldn't be established I suppose
[15:21:37] <namidark> Derick: any ideas on the config issues?
[15:22:02] <Derick> namidark: nope, sorry - I've not worked with sharding myself yet
[15:22:13] <namidark> ok thanks anyways :)
[15:31:20] <feklee> I'm using mongodb for node.js, and I successfully connected to a DB. But there seems to be no "save()" method, which I've seen in various examples, e.g.: http://www.youtube.com/watch?v=w5qr4sx5Vt0&feature=player_detailpage#t=963s
[15:32:41] <feklee> Furthermore, "db.posts" is undefined, although I created a "posts" collection using "db.createCollection()".
[15:33:17] <feklee> Are examples using "save()" outdated? Are they depending on a different driver?
[15:34:58] <int> hey
[15:36:22] <int> I am making an analytics prototype with mongodb. I am tracking a "Product Viewed" event. Everytime I product page is loaded, I dump a record in a collection with all the required metadata such as product name, id, username of user who viewed it.
[15:37:05] <int> what's a good way to query this collection to get out all the page views for for a specific product name
[15:37:25] <int> and then filtering out stuff like all products viewed by a particular username
[15:44:59] <eka> hi all, dumb question, in what affects the creation of an index with direction (asc/desc)? the ordering?
[15:49:08] <SLNP> Hi, what does getShardVersion: "mdbfoo.foo" relate to?
[15:59:31] <choffstein> Hi all! I have a schema design question for you. I am trying to create a collection of documents for stock information. Within each document will be information about the company, the cusip, and time-series data for how the stock was trading. I want the ability to update the time-series without necessarily having to fetch the full document, alter it, and update it. a) is there a way for me to "append" a sub
[15:59:31] <choffstein> -document without downloading the document or the sub-document, or b) is there a better way for me to design my schema?\
[15:59:39] <choffstein> Sorry that was so long :)
[15:59:55] <bradc> morning mongo folks!
[16:02:00] <eka> choffstein: there is ... see update $addToSet
[16:02:09] <choffstein> eka: Awesome. Thanks :)
[16:02:14] <eka> np
[16:02:21] <bradc> If I remove a replica member and then add a new one in a sharded setup, should I have to update the shard config on the config servers ?
[16:58:30] <mw44118> Hoe
[16:59:47] <mids> you are a Hoe
[17:22:41] <tystr> is there a way to set slaveok globally for a node? like, in the configuration or something, instead of having to do rs.slaveOk() for each connection?
[17:26:33] <ranman> tystr: rs.reconfig({someconfiguration}) doesn't let you do that?
[17:27:04] <TrahDivad_> Can someone tell me if it's possible do a find AND a count in one query?
[17:27:07] <tystr> ranman i dont' know, that's what I'm asking :D
[17:28:05] <tystr> ranman looking here, I don't see that it's possible http://www.mongodb.org/display/DOCS/Replica+Set+Configuration
[17:28:56] <adamcom> TrahDivad_: not using the count command, but
[17:28:58] <adamcom> find({ status: 10 }).itcount()
[17:29:05] <adamcom> or similar on the shell
[17:29:32] <adamcom> tystr: it's set per connection (slaveOK) I believe
[17:29:43] <TrahDivad_> itcount? Can't find it in the docs...
[17:29:54] <tystr> adamcom indeed, it seems that's the only way :(
[17:30:47] <ranman> if you're using a driver you can set a read preference on a per-connect/per-operation basis
[17:31:53] <tystr> yeah
[17:32:38] <tystr> basically our BI guy is trying to do reporting off of a secondary, and with the software he's using doesn't seem like we can set the slaveok option
[17:35:44] <adamcom> TrahDivad_: if you run it without the parens you will see it's just a bit of javascript in the shell to iterate the cursor and count each iteration
[17:37:03] <adamcom> db.foo.count({status : 10}) returns the same thing
[17:37:20] <adamcom> I was just being explicit in my response to your question :)
[17:38:39] <TrahDivad_> adamcom: but can I get the data from the find also? I'd like both.
[17:42:21] <adamcom> if you get the data from a find, just do the count on the client side
[17:43:27] <adamcom> if you are asking can you do that from the shell, then I don't know of a way
[18:08:44] <chubz> PHP Warning: Module 'mongo' already loaded in Unknown on line 0. Any ideas?
[18:45:18] <halcyon918> hey guys, do you know if it's possible to execute two atomic updates to the same document, in a single call? I need to set two fields on a document and didn't want to make two calls if I could do it in one…
[18:46:02] <lizzin> so a database contains collections and collections contain documents, right?
[18:46:24] <halcyon918> something like: { $set : {firstName : "bob"}, $set : {lastName : "smith"} }
[18:46:55] <halcyon918> (which I know doesn't work, just using that as an example)
[18:48:06] <ron> {$set : {"firstname":"bob", "lastname":"smith"}} ?
[18:51:44] <halcyon918> ron: yup… thanks! (brain fart, I suppose)
[18:52:00] <ron> I sure hope that's your excuse.
[18:54:29] <lizzin> i created a db from within an app, added a few documents and now i have some files in /data/db/. the database created in the app is called 'phonebook'. the files i see in /data/db/ are phonebook.1, phonebook.0, phonebooks.1, phonebooks.0, phonebook.ns, and phonebooks.ns
[18:54:33] <lizzin> what are these files?
[18:54:47] <lizzin> and why can't i access this db from within the mongo client `mongo`?
[18:55:02] <switz> Is there a way to search for all empty collections in a database?
[18:56:34] <ron> you have that many collections?
[18:56:50] <switz> yes?
[18:57:10] <robbe_> what would be the best practice of storing comments to a given article? inside the article collection or in a seperate comments collections, just storing the reference object id to the article?
[18:57:21] <ron> really?
[18:57:53] <ron> robbe_: that really depends on a whole set of questions.. like how you want to query your data and so on.
[18:58:17] <switz> really? I just said so...it makes more sense to come here and ask if that's possible than go through 40 collections by hand.. so yes.
[18:58:34] <ron> only 40 collections?
[18:59:24] <switz> yes, only 40. would you like to do it by hand for me?
[18:59:55] <switz> actually it's more like 68
[18:59:56] <ron> sure, it'll take 5 minutes at most.
[19:00:03] <ron> fine. 5.5 minutes.
[19:02:58] <robbe_> ron, storing them in a extra collection feels so "relational" ^, but i guess i will go do it that way
[19:03:17] <ron> robbe_: uh, what? :)
[19:04:02] <dardevelin> hi, i'm not sure if this is the correct place to post this kind of questions. I just installed mongodb 1:2.0.6-1 from my sid repository and automatically selected the dependencies mongodb-dev mongodb-server mongodb-clients of the corresponding version. all went fine. i can see that mongo is up and running after installation. So I am trying to compile this -> http://api.mongodb.org/c/current/tutorial.html tutorial, but I can't file whe
[19:04:02] <dardevelin> re the mongo-c-driver is located and or mongo.h file
[19:04:54] <dardevelin> so my request is, can someone give me directions on where can i find them ? did I missed some packaged or something ? thanks in advance
[19:06:12] <ron> dardevelin: have you looked at the following page from that link?
[19:06:44] <dardevelin> yes it used /path/to/mongo-c-driver
[19:07:52] <dardevelin> s/used/uses
[19:08:28] <ron> dardevelin: https://github.com/mongodb/mongo-c-driver/blob/master/src/mongo.h
[19:09:55] <dardevelin> ron, eh, do I really have to get it from github ? I mean that completely loses the point of having a package manager in first place
[19:17:32] <algernon> dardevelin: the official C driver is not packaged for Debian
[19:18:05] <dardevelin> algernon, oh ok, that explains it then. thanks :)
[19:18:06] <algernon> dardevelin: however, if you want a packaged C driver, there's libmongo-client0
[19:18:49] <dardevelin> humm, let me checkout were they differ then . Thanks once again :)
[19:18:50] <lizzin> what are .1 and .ns files in my /data/db ?
[19:19:19] <ron> whoops.
[19:19:39] <algernon> dardevelin: the official driver is pure C, libmongo-client uses glib underneath, and has a different API, an extensive test suite and all that stuff. It didn't break API or ABI for quite a while yet, while the official driver did both :P
[19:20:37] <dardevelin> oh thats interesting
[19:20:40] <ron> I miss MACYet3.
[19:28:27] <Zelest> Derick, around? :-)
[19:48:49] <wereHamster> lizzin: why do you want to know?
[21:31:03] <diegok> kchodorow: are you there?
[21:31:37] <diegok> kchodorow: is there any plans to release a new version of the perl driver to cpan?
[21:32:20] <diegok> kchodorow: I've fixed it to work with array references the same way it works with Tie::IxHash https://github.com/diegok/mongo-perl-driver/commit/6dc2ab6593cdfe45d40c62b0e5052b24a872dd28
[21:32:51] <diegok> kchodorow: it was documented to work on some parts but it didn't
[21:33:13] <diegok> kchodorow: I've added some tests for it
[21:33:35] <kchodorow> diegok: cool!
[21:33:48] <diegok> kchodorow: I would like to implement retry
[21:34:36] <kchodorow> retry?
[21:34:41] <diegok> kchodorow: I was about to send you a pull request but I would like to see this hitting cpan :-)
[21:35:01] <kchodorow> yeah... right now it's broken on windows and i haven't gotten around to fixing it
[21:35:13] <kchodorow> that's what's been holding up the cpan release
[21:35:21] <diegok> kchodorow: oh!, windows.... hell :-/
[21:35:25] <kchodorow> yeah...
[21:35:56] <kchodorow> but feel free to pull request
[21:36:06] <diegok> kchodorow: I would like to help but I have 0 idea of windows
[21:36:20] <diegok> retry I mean on a RS
[21:36:30] <kchodorow> i'll probably have to do a release in the next month, so i'll suck it up and deal with windows soon
[21:37:09] <diegok> catch the error and retry after findeng primary or if slave_okey try the others
[21:37:54] <kchodorow> we want the retry logic to be very similar between languages
[21:38:32] <kchodorow> so what do you mean about retry after finding primary?
[21:38:48] <kchodorow> like, if the primary goes down and you need to find a new one?
[21:42:42] <diegok> right
[21:43:04] <diegok> well, I didn't gave it a long thinking really...
[21:43:25] <diegok> but I need it to be solved at driver level
[21:43:43] <kchodorow> okay, you can only retry non-command queries
[21:43:49] <kchodorow> but i'd merge that in
[21:44:08] <kchodorow> and the perl driver doesn't support routing reads to secondaries at the moment
[21:44:27] <kchodorow> so it'll need to support that before trying other slaves on slave_okay
[21:45:08] <diegok> kchodorow: oh!, so, when I set slave_okay it does nothing at this time?
[21:45:23] <kchodorow> not unless you're connecting directly to a secondary
[21:46:01] <diegok> how it works on the other drivers?, is there some docs on how a driver should behave?
[21:46:26] <kchodorow> no, the other drivers automatically send reads to secondaries when slave_okay is set
[21:46:37] <kchodorow> one sec, not sure if the spec on this stuff is public yet
[21:47:09] <Derick> I don't think it is
[21:47:18] <Derick> the idea is that the spec makes it into driver docs :-)
[21:48:19] <kchodorow> seems like it should be in a central place, too
[21:49:12] <Derick> I don't disagree, but that's not what I figured
[21:49:23] <diegok> kchodorow: can you give me a hint (now or when you have the time) on where to look to implement this thing on the perl driver?
[21:49:33] <Derick> i'm off, night!
[21:49:39] <diegok> night!
[21:49:39] <kchodorow> Derick: good night!
[21:52:49] <kchodorow> diegok: yeah, let me think about how to approach it, ping me about it later?
[21:53:47] <diegok> kchodorow: ok, it's a bit late here (europe) but I'll try in a couple of hours...
[21:53:57] <kchodorow> how about tomorrow?
[21:54:02] <diegok> fine :)
[21:54:04] <kchodorow> cool
[21:54:33] <diegok> I asume you'll be easier to find late as I asume you are in the US...
[21:55:18] <diegok> but I'll be here connected so letme know if you think something about it.
[23:37:43] <DigitalKiwi> hmm
[23:38:29] <DigitalKiwi> so say I want to represent a follower/followee relationship, I could do it like { "_id" : ObjectId("4ffea5e32e28a6ff0ce9d50b"), "fe" : ObjectId("4ffe77e42e28a6ff0ce9d4e0"), "fr" : ObjectId("4ffe77e42e28a6ff0ce9d4e0") }
[23:38:45] <DigitalKiwi> and have db.friendships.ensureIndex({fe:1, fr:1}, {unique: true})
[23:40:06] <DigitalKiwi> now that will keep me from trying to add the same relationship right, but to keep from erroring I still have to check before I try to add one, which means if I'm checking anyway, do I need the index? Or is it good to have it just to make sure I don't...and should catch the error too...