PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 23rd of October, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:20:51] <symbol> so `update` is deprecated and `updateOne` is recommended...but `findOne` is depreacated. Seems like they'd want to keep that one around in the node driver.
[01:26:08] <StephenLynx> fineOne deprecated?
[01:26:30] <symbol> Says it is in the docs
[01:26:36] <symbol> http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#findOne
[01:27:00] <StephenLynx> >use find().limit(1).next(function(err, doc){})
[01:27:04] <StephenLynx> HAHAHAHSDJAHSDJHASDHJAHSDHASDHADJAHSJKDKJASDHKJASJDHKAJSDJASDAS
[01:27:28] <StephenLynx> ffs
[01:27:33] <StephenLynx> that guy has lost it
[01:27:40] <symbol> I'm not misreading it am I?
[01:27:48] <StephenLynx> no, you read it perfectly.
[01:28:04] <StephenLynx> he really said findOne is deprecated and tells you to use all that crap instead
[01:28:15] <StephenLynx> I wish you had misread.
[01:28:37] <StephenLynx> nevermind the fact THE TERMINAL HAS FINDONE
[01:29:02] <symbol> I was all about updateOne to express intention so I naturally assumed findOne instead of find. NOPE
[01:29:39] <StephenLynx> screw that, I am not going to stop using findOne
[01:29:52] <StephenLynx> its asinine
[01:30:09] <symbol> I checked Jira for some sort of discussion. Nothing.
[01:30:14] <StephenLynx> findOne was made SPECIFICALLY so you wouldn`t have to write a bunch of crap.
[01:30:37] <StephenLynx> I wouldn;t bother too much, deprecated means only "some text on the docs" for him
[01:31:04] <StephenLynx> I think it will never be actually removed or even give you a warning.
[01:31:25] <StephenLynx> its been a while since I got a bad impression of that guy.
[01:31:53] <StephenLynx> but hey, hes doing it for free, isn`t he :v
[01:31:59] <symbol> eh, yeah.
[01:32:17] <StephenLynx> just keep in mind if you ever feel liking improving this driver
[01:32:29] <StephenLynx> it isn`t exactly the sharped blade in the drawer
[01:32:34] <StephenLynx> sharpest*
[01:33:19] <symbol> haha
[01:34:03] <StephenLynx> i dove into it once, I found the code extremely confusing,
[01:34:20] <StephenLynx> he abuses way too much of pseudo OOP
[01:34:24] <symbol> Looks like it was deprecated in v2.1-alpha
[04:14:59] <symbol> Well shit. Node.js driver doesn't have $elemMatch.
[04:15:02] <symbol> That's inconvenient.
[04:18:19] <fullstack> loonies have taken over the repo!
[04:18:58] <symbol> </3
[04:19:14] <symbol> But really. That's dumb.
[04:19:52] <fullstack> 9/10 I use findOne to sample the schema so I can fix whatever is wrong with my query real quick in some terminal on a remote server
[04:20:14] <symbol> Yup!
[04:24:48] <fullstack> I went down the path of writing in the mongodb a driver in bluebird Promisify
[04:24:51] <fullstack> what have I done
[04:25:59] <symbol> Oh my o.0
[07:45:27] <the_german> I iterate over a collection with forEach. This takes quite a long time. The query always stop after almost exactly 3600s. I already set the noTimeout option
[08:15:07] <Zelest> Derick, is there any way to print/convert the query to mongo client json?
[08:15:26] <Zelest> Derick, that is, from a php array to the query being used in the mongo cli shell.
[08:17:46] <Derick> Zelest: json_encode ?
[08:18:06] <Zelest> oh, that's enough?
[08:18:12] <Derick> I don't know
[08:18:18] <Derick> your question was a *little* vague
[08:19:43] <the_german> Maybe a little more people are online now. I do the following query db.inventory.find().addOption(DBQuery.Option.noTimeout).forEach( ..myFunction...). It works great and fast but it stops exactly after 1h or 3600 seconds. I have no idea why
[08:20:04] <the_german> Nothing in the log. it just stops
[09:19:15] <Zelest> Apart from RAM and storage being obvious, should one invest in a powerful CPU while buying a machine for MongoDB?
[09:20:37] <Derick> it's more important with WiredTiger as it's a lot faster... CPU is handy if you do non-indexed sorts, or aggregation framework stuff a lot
[09:20:52] <Derick> I wouldn't necessarily pick the most expensive top of the line CPU though
[09:20:56] <Derick> just a "good one"
[09:21:00] <Derick> if that makes sense?
[09:21:20] <Zelest> Ah, yeah
[09:25:14] <Zelest> Havn't played with WiredTiger at all actually
[11:11:11] <livcd> how do i remove the 3rd subdocumment in a collection ?
[11:13:12] <livcd> "doc" : { first_sub : { ... }, second_sub : { ... }, third_sub: { ... } }
[11:13:57] <cheeser> $unset
[11:19:29] <livcd> but how do i select / specify the third sub document ?
[11:41:42] <symbol> Wow. Embedding comments in an array sorta suck if you want to update with the node.js driver.
[12:02:57] <livcd> ah got it
[13:25:28] <pamp> Hi
[13:26:08] <pamp> I know that "$ne" doesn t work well with indexes
[13:26:28] <pamp> Is there any alternative no make this kind of queries
[13:27:13] <pamp> my problem is querying a collection with more than 10 millions documents, where the field "i" is not equal to "n/a"
[13:27:25] <pamp> I have an index in the field "i"
[13:27:45] <pamp> but this query is very slow
[13:41:10] <cheeser> pamp: you know that? how so?
[14:00:22] <Thinh> Hey guys--quesiton regarding memory stats when using wiredtiger
[14:00:49] <Thinh> I'm looking at resident and virtual numbers, and it seems very low
[14:01:03] <Thinh> do they numbers not include the wiredtiger engine? and only apply for nmapv1?
[14:33:18] <pamp> @cheeser because is in the docs
[14:33:20] <pamp> For instance, the inequality operators $nin and $ne are not very selective since they often match a large portion of the index. As a result, in many cases, a $nin or $ne query with an index may perform no better than a $nin or $ne query that must scan all documents in a collection.
[14:36:32] <cheeser> pamp: i've not heard that. url?
[14:38:44] <pamp> https://docs.mongodb.org/manual/core/query-optimization/
[14:40:20] <cheeser> oh, i see.
[14:43:54] <pamp> I created a sample collection with 2000 docs, 1000 of them have "i" field with "n/a". I made a query to find {i:{$ne:"n/a"}}
[14:44:51] <pamp> examined all the documents (2000) and returned the (1000) docs how have this field with "n/a"
[14:45:26] <pamp> **who**
[14:52:26] <Lujeni> Hello - i stop one cfg server and when i try to restart him, mongos display this error: "requested shard version differs from config shard version for" Any idea pls? thx
[15:17:52] <dufabricio> Hi.. i need update a specific element in array by key..
[15:18:22] <dufabricio> I was trying to use the $set function..
[15:19:20] <dufabricio> { "_id" : ObjectId("562a49ecf7f9bdbcf4468d7d"), "auctionId" : NumberLong(32545), "monitoredUsers" : [ { "user55" : true }, { "user66" : true }, { "user77" : true }, { "user88" : true } ], "operatorId" : NumberLong(32154) }
[15:19:32] <dufabricio> i want to update user55 to false
[15:19:57] <dufabricio> https://docs.mongodb.org/v2.6/reference/operator/update/set/
[15:20:43] <dufabricio> following documentation i could do it .. db.products.update( { _id: 100 }, { $set: { "tags.1": "rain gear", "ratings.0.rating": 2 } } )
[15:22:50] <dufabricio> however , i would like to use key "user55" . Anybody knows hwo to do that ?
[15:24:59] <dufabricio> my bad, I was trying using a wrong ID in find query lol
[15:25:38] <dufabricio> .update({operatorId:32154},{$set:{monitoredUsers:{user55:false}}}) < it works..
[15:26:41] <livcd> { $unset: { array: "" } }
[15:26:57] <livcd> will this remove key/pair array or will it just truncate ?
[15:48:20] <deathanchor> livcd: removes it
[15:52:12] <whyhankee> Hi all, i'm have some questions about cloud.mongo.com and the required agents for automated backup & restore. I prepare a little paste, could someone provide some small insights please? http://pastebin.com/UiAJWTDt
[15:52:57] <whyhankee> or provide the link to a bit of clear documentation. I could not get this clear from the mongodb docs :(
[17:01:54] <hemangpatel> Hello
[17:02:13] <hemangpatel> I have 3 nodes Replica set. 1 primary and 2 secondary
[17:03:13] <hemangpatel> If 1 secondary goes down, i'm not able to request from another secondary.
[17:03:19] <hemangpatel> I'm using php driver
[17:04:12] <hemangpatel> In general how mongodb will behave if one secondary goes down ?
[17:11:27] <hemangpatel> I'm using nearest read Preference
[17:14:50] <hemangpatel> Anyone ?
[17:46:28] <deathanchor> it should just go to whatever is available
[18:39:02] <morenoh149> does a $where function have access variables from the program? I'm using node.js
[19:07:25] <danielemm> hi, is mongodb compatible with ARM/iOS?
[19:26:58] <cheeser> not quite and no.