PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 30th of March, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[05:35:49] <AlecTaylor> hi
[05:39:56] <AlecTaylor> How should I work with schemaless NoSQL? - Develop an ORM/ODM; use this REST design (http://programmers.stackexchange.com/q/234191) or some other method?
[10:02:27] <ernetas> Hey guys.
[10:02:41] <ernetas> Why my single node replica set has only secondary node?
[10:02:45] <ernetas> What could be the issue?
[10:20:47] <mylord> db.turnys.find( {gId:ObjectId(“xyz”), users: { $size:{ $gr:{0} } } } )
[10:20:53] <mylord> JavaScript execution failed: SyntaxError: Unexpected token }
[10:20:59] <mylord> anyone see the prob there?
[10:23:44] <mylord> db.turnys.find( {gId:ObjectId("xzp"), users: { $size:{ $gt:0 } } } )
[10:34:08] <mylord> how can I do this? db.turnys.find( { users:{$size:"seats" } } )
[10:34:33] <mylord> / where seats seats is a value in each turnys document?
[10:34:57] <mylord> and how about this? db.turnys.find( { users:{$size:{$gt:1} } } )
[10:35:03] <mylord> the gt doesn’t seem to work in this case
[10:38:06] <joannac> ernetas: what does rs.status() say?
[11:25:02] <ernetas> joannac: nevermind, it somehow restored on itself...
[11:25:08] <ernetas> So, the next problem I'm facing...
[11:25:16] <ernetas> I'm trying to add a new replica to a replica set.
[11:25:52] <ernetas> My cluster consists of 2 shards, each of which I want to have a separate replica set.
[11:26:21] <ernetas> So I did rs.initiate, configured everything casually. The same operations worked well with other databases.
[11:26:47] <ernetas> But with these 2 shards, I can't seem to add a replica. Somewhere 5-6 hours into initial sync, I get:
[11:28:05] <ernetas> https://gist.github.com/ernetas/9871437
[11:28:09] <ernetas> What could be the issue?
[11:28:32] <ernetas> The secondary simply crashes...
[11:30:36] <ernetas> Pretty much the same on another shard secondary - https://gist.github.com/ernetas/9871469
[11:32:02] <ernetas> Oh, nevermind, figured it out...
[11:43:38] <thearchitectnlog> hey guys does
[11:43:39] <thearchitectnlog> db.bios.update(
[11:43:39] <thearchitectnlog> { _id: 1 },
[11:43:39] <thearchitectnlog> {
[11:43:39] <thearchitectnlog> $push: { awards: { award: "IBM Fellow", year: 1963, by: "IBM" } }
[11:43:39] <thearchitectnlog> }
[11:43:39] <thearchitectnlog> )
[11:43:57] <thearchitectnlog> create an awards if the array doesnt exist
[11:43:58] <thearchitectnlog> ?
[15:23:48] <mylord> anyone?http://hastebin.com/tolavoyewa.sm
[15:23:56] <mylord> or this date problem? http://hastebin.com/midutegiqu.vbs
[15:26:48] <mylord> lost conx, did anyone answer this $size question? http://hastebin.com/tolavoyewa.sm
[15:27:38] <cheeser> for the record, http://irclogger.com/.mongodb/2014-03-30
[15:28:08] <cheeser> what are you trying to do?
[15:29:33] <mylord> cheeser: i’m trying to see if there are any turnys that have as many users as seats, if so, i’ll need to make another turny
[15:29:47] <mylord> I also have this problem: anyone know how to fix this new Date() problem going from node to mongo http://hastebin.com/midutegiqu.vbs
[15:30:51] <cheeser> i'm not a node user but why not just pass the date directly in to the query builder?
[15:38:51] <mylord> query builder? main problem is mongo, at leat from console, doesn’t like quotes around the “new Date(xyz)”, and I don’t know how to remove that
[15:38:57] <mylord> cheeser: how about the first problem?
[15:40:29] <mylord> how to compare an array size against a different item value?
[15:41:04] <stefuNz> Hello. How can i delete everything from a collection, but not the 1000 last inserted documents? unfortunately, capped collections are not an option, because i need to update and resize the documents.
[15:45:11] <cheeser> mylord: you'd have to use the aggregation framework for that.
[15:46:06] <mylord> cheeser: can you spell out the line i should use, to speed up this newbie quest?
[15:46:19] <cheeser> what?
[15:46:53] <mylord> cheeser: what exactly can i type into the mongo shell to achive this? db.turnys.find( { users:{$size:seats } } )
[15:47:26] <cheeser> you'd build an aggregation piple and run that.
[16:00:54] <mylord> is it safe to send users mongodb _id from users db/collection as later identifier?
[16:10:36] <cheeser> sure
[16:35:10] <mylord> how do i sort this, or findOne with the highest rMin?
[16:35:14] <mylord> db.turnys.find({"gId":ObjectId(“123”),”rMin":{"$lte":1000},"rMax":{"$lte":1000}})
[16:37:09] <cheeser> order by rmin
[16:39:02] <mylord> k, ya, this works: find(xyz)._addSpecial( "$orderby", { rMin : -1 } )
[16:39:29] <cheeser> .sort({"rMin" : -1})
[16:40:18] <mylord> addSpecial works with find, but not findOne
[16:40:19] <mylord> .sort and .orderby gives this error
[16:40:25] <mylord> Object [object Object] has no method 'sort'
[16:40:40] <mylord> how to do it on findOne?
[16:41:08] <cheeser> you can't use findOne()
[16:41:16] <cheeser> sort with a limit(1)
[16:41:26] <mylord> ie, grab the one with highest rMin
[16:42:38] <mylord> but then its not ordered.. how can i get the highest rMin only?
[17:14:14] <LoneStar99> hello everyone
[17:14:59] <LoneStar99> need to fetch all from a collection, code working in php, now need for node.js --> need simple with a simple --> collection.find() -> working code in php --> http://pastebin.com/UbxSMzWq
[17:15:33] <LoneStar99> broken english, was up late lastnite, moonshine....
[18:38:12] <ernetas> Anyone here from mongodb developers?
[18:42:14] <ernetas> Could anyone explain to me why mongod feels like it should set itself as primary when it looses connection to a secondary, which has a priority of 0 and hidden set to true? It's unreasonable.
[18:42:32] <ernetas> There are no other nodes.
[18:54:50] <ernetas> Okay...
[18:54:55] <ernetas> https://gist.github.com/ernetas/9877727 - why does this keep happening?
[18:55:00] <ernetas> It's getting anoying.
[19:23:32] <LoneStar99> howdy need help with a findOne query --> http://pastebin.com/HwTvNhgb
[19:45:18] <cheeser> LoneStar99: is that the node driver? i'm guessing it's because that console.log(item); bit should be between your callback's {}
[19:45:30] <cheeser> as it looks now, it's just hanging out on its own line.
[19:46:10] <LoneStar99> cheeser: yes correct node driver
[19:48:43] <LoneStar99> cheeser: ok fixed that, but now I simply get "null" in console.log
[19:57:46] <rkgarcia> LoneStar99: http://pastebin.com/CJZZia84
[19:58:03] <rkgarcia> check the console.log line :) i change the place
[20:03:39] <ernetas> Hm..
[20:03:41] <ernetas> Anyone here?
[20:04:17] <LoneStar99> rkgarcia: ok let me check it out
[20:04:18] <LoneStar99> thanks
[20:04:34] <rkgarcia> LoneStar99: you're welcome
[20:04:41] <rkgarcia> ernetas: yep o/
[20:05:28] <ernetas> https://gist.github.com/ernetas/9878854 - why could I keep getting this?
[20:05:39] <ernetas> tcp keepalives are set to 300 as recommended on both machines.
[20:07:10] <rkgarcia> you have a problem with the primary
[20:07:18] <LoneStar99> rkgarcia: is the query correct though?
[20:07:31] <ernetas> rkgarcia: what could it be?
[20:08:04] <rkgarcia> and LoneStar99 do you have a field called "53180f903336131cc4e8cddd" with a value "count_property"
[20:08:05] <rkgarcia> ???
[20:08:32] <rkgarcia> ernetas: you have troubles with the primary and the members are setting the new primary
[20:09:51] <ernetas> What do you mean the members are setting the new primary? That's a 2 node replica set. The other node is priority 0, hidden true.
[20:10:07] <LoneStar99> rkgarcia: nope so could it be {'count_property' : '53180f903336131cc4e8cddd'); ??
[20:10:51] <rkgarcia> LoneStar99: yep
[20:10:59] <rkgarcia> in json {field:value}
[20:12:02] <LoneStar99> ok thank you
[20:12:59] <ernetas> https://gist.github.com/ernetas/9878989 from primary, https://gist.github.com/ernetas/9878937 from secondary.
[20:13:02] <ernetas> Clocks are in sync.
[20:14:26] <ernetas> To me, it does not look so obvious that something is wrong with the primary.
[20:14:42] <rkgarcia> there are three members in replSet?
[20:15:01] <ernetas> no, 2. I only want to do backups.
[20:15:19] <rkgarcia> do you have sharding?
[20:15:22] <ernetas> Yes.
[20:15:55] <LoneStar99> rkgarcia: had it wrong, but it is now cleared up
[20:21:15] <ernetas> rkgarcia: is there anything I can do?
[20:22:24] <rkgarcia> a replSet need more than 50% of merbers running
[20:22:47] <rkgarcia> if you have a 2 members replSet you have a problem if one is down
[20:23:08] <rkgarcia> and your logs says "Sun Mar 30 22:55:03.632 [rsHealthPoll] replSet member backup:20002 is now in state DOWN"
[20:25:47] <rkgarcia> see you guys
[20:26:18] <mbroadst> hey I'm using the mongo native node module to stream some results into an expressjs response via: collection.find(..).stream().pipe(JSONStream.stringify).pipe(response). It works just fine the first time, but subsequent requests fail. Anyone done something like this before?
[20:26:31] <garbagegod> How would I take a document with a date and modify the date?
[20:26:42] <garbagegod> the docs on updating aren't really helpful here
[20:27:04] <garbagegod> doing an update works, but the rest of the document is deleted except the field I update
[20:27:26] <rkgarcia> db.collection.update(query,{$set:{fieldDate:newDate}})
[20:27:39] <garbagegod> wow I'm stupid
[20:27:40] <rkgarcia> garbagegod: remember use $set for atomic updates
[20:27:41] <garbagegod> thank you
[20:27:47] <garbagegod> thanks a lot
[20:27:55] <rkgarcia> garbagegod: you are welcome :)