PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 7th of July, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[03:22:58] <jonjon> I'm working in mongoDB console and getting "remove needs a query at src/mongo/shell/collection.js:299" when I do db.incoming.remove()
[03:23:12] <jonjon> on a database I just use db.copyDatabase() to create
[03:23:19] <jonjon> *used
[03:25:33] <jonjon> If I put some selector in db.incoming.remove({"name":"something"}) it works ok
[03:25:44] <joannac> yup
[03:25:53] <joannac> or db.incoming.remove({})
[03:25:59] <jonjon> I have used db.incoming.reomve() all the time before though
[03:26:02] <jonjon> oh ok
[03:26:07] <joannac> if you really want to remove everything
[03:26:23] <jonjon> is this a new requirement or am I crazy?
[03:26:31] <joannac> new requirement
[03:26:34] <joannac> lookign for the ticket now
[03:26:40] <jonjon> ok great thanks
[03:26:48] <cheeser> yeah. new in 2.6.
[03:27:04] <cheeser> it's safer is the reasoning.
[03:27:09] <joannac> https://jira.mongodb.org/browse/SERVER-12409
[03:27:21] <jonjon> yeah seems like a good idea
[03:38:36] <boxxa> can someone point me to a tutorial that uses a persistent connection to a mongo db? all the ones I found show the connection and then functions inside it
[03:38:48] <cheeser> come again?
[03:38:51] <boxxa> i want my nodejs app to have a connection object and then call a function to insert data on that connection
[03:38:58] <cheeser> oh. node.
[03:39:15] <boxxa> it seems every tutorail shows the constant open/close of the mongo connection which i fell is bad for a mongolabs db
[05:25:22] <mehwork> when the bluebird docs say to Promise.promisifyAll(require("mongodb")); do they mean to var mondodb = Promise.promisifyAll(require("mongodb")); ?
[05:44:53] <AliRezaTaleghani> What will be happend if my mongod instance be killed and the repairCommand is running?
[05:46:29] <AliRezaTaleghani> the actual problem is I had runned mongod --repair on a session which was not running on screen
[05:46:43] <AliRezaTaleghani> and I loss the ssh connections
[05:47:38] <AliRezaTaleghani> right now it seem's the shard is in running status (due to disk utilizations and lock on the shard) :-/
[05:48:25] <AliRezaTaleghani> I'm not sure what will happed if i restart the mongod instance...
[06:21:17] <tacoshellmcgee> Is mongodb short for mongoloid db?
[07:05:22] <Azmath> hi team
[07:05:39] <Azmath> i have query about mongo db dates related
[07:07:22] <Azmath> In PHP & MongoDB, i am trying to read all instances of events for a specific calendar and a specific period. Each event has start and end date. They are of MongoDate type in mongodb.
[07:07:23] <Azmath> I use below condition to get the events from mongo.
[07:07:23] <Azmath> $condition = array(
[07:07:23] <Azmath> 'start_time' => array('$gte' => new MongoDate($start_day)),
[07:07:23] <Azmath> 'end_time' => array('$lte' => new MongoDate($end_day))
[07:07:23] <Azmath> );
[07:07:24] <Azmath> Here is my problem, i am missing the events whose start date is to my date range.
[07:07:24] <Azmath> For example
[07:07:24] <Azmath> event starts on <b>01-july-2014</b><br>
[07:07:25] <Azmath> event ends on <b>10-july-2014</b>
[07:07:25] <Azmath> my mongo query - give me events from 5-july to 12-july
[07:07:26] <Azmath> $condition = array(
[07:07:27] <Azmath> 'start_time' => array('$gte' => '5-july-2014'),
[07:07:27] <Azmath> 'end_time' => array('$lte' => '12-july-2014')
[07:07:28] <Azmath> );
[07:07:28] <Azmath> Any suggestions are welcome?
[07:12:07] <styles> is every map reduce key/value based?Or can I map reduce based on groupping a specific property
[07:12:18] <styles> I'm a noob just trying to play w/ map reduce & mongo
[07:13:15] <joannac> Azmath: sounds like your logic is wrong
[07:13:41] <joannac> you want events where end-date > your query's start date, OR events where start-date < your query's end date
[07:16:10] <joannac> styles: map reduce is key/value based. you can construct your own keys to group on
[07:22:51] <Azmath> Joannac - if i use that logic, then query will return all the records before the end-date, query does not consider the start-date
[07:29:07] <joannac> Azmath: oh
[07:29:27] <joannac> so all events where either start date or end date or both fall within the period?
[08:36:46] <Azmath> yes JOANNAC
[08:37:06] <Azmath> between i got the answer http://stackoverflow.com/questions/24604651/mysql-between-equivalent-in-mongodb?noredirect=1#comment38124282_24604651
[08:44:39] <rspijker> Azmath: that can be done far less verbose…
[08:44:58] <rspijker> Let’s say that your fields are start and end. And you are querying for start_query and end_query.
[08:45:33] <rspijker> then you can simply look for: start <= end_query && end >= start_query
[08:45:51] <rspijker> that should match any interval that overlaps with your query interval
[08:46:03] <rspijker> (assuming your intervals are ‘proper’)
[08:46:52] <rspijker> o, nvm, that’s exactly what Phillip said on your SO post
[09:16:14] <Azmath> RSPIJKER, for some reason that query didn't return anything
[09:17:15] <rspijker> well… it should :)
[09:17:42] <Azmath> may be i am doing some mistake, the first reply in SO, worked fine, so i just follwed that, i will check your solution later in the evening here. for me logically your answer sounds correct not sure what mistake i did
[09:17:49] <Azmath> i will verify that later
[09:18:08] <Azmath> between RSP, thank for your instant help.
[09:19:58] <rspijker> good luck :)
[10:39:51] <_NiC> Let me know if this is way off-topic, but has anyone used mongoose (client library) and experience that it doesn't reconnect to secondaries if they are restarted?
[10:41:43] <_NiC> I wonder if it's this: https://github.com/LearnBoost/mongoose/issues/1672
[10:42:02] <_NiC> We're on 3.5.5, so maybe I'll poke the developers and have them look into upgrading..
[11:42:18] <netQt> hi all, i want to dump my db and remove dumped data from it. the thing is that i will get new write requests while dumping data. how do i remove data that was dumped?
[11:57:04] <torgeir> can a db.collection.update() with multi true update several fields of all documents in one query on mongodb 2.4.8?
[12:24:26] <shoshy> hey, i'm trying to use $addToSet with $position, but couldn't find how to write it . I have an object with an array property, trying to insert through it's head without duplication
[12:24:28] <Leech> hi, somebody from MongoDB inc? MMS support forms aren't working
[14:35:33] <raffopazzo> hello
[14:35:58] <raffopazzo> I'm trying to cross-compile mongo to a MIPS platform
[14:36:28] <raffopazzo> and I obviously have compilation errors from scons
[14:36:46] <raffopazzo> is this a good place to ask for this kind of technical help ?
[14:38:31] <cheeser> there's a mongodb-dev list that would probably be more helpful.
[14:39:11] <Guest0815> hi
[14:39:59] <Guest0815> can i get help here for pymongo too? or should i go somewhere else :D
[14:41:41] <Guest0815> okay...
[14:42:33] <Guest0815> via python i try a bulk-insert: db.coll.insert( myarray, continue_on_error=True)
[14:43:05] <Guest0815> as i try to insert data which are perhaps already there i get DuplicateKeyErrors from time to time
[14:43:30] <Guest0815> i enclosed the insert in a try: except DuplicateKeyError: block
[14:44:00] <Guest0815> but: (now my point) how can i get the information how many inserts where successful and how many failed through Errors?
[14:44:12] <Guest0815> mongodb itself returns an array of objectids
[14:59:28] <Guest0815> but i can't get it in python as the exception ends the processing
[15:00:22] <kk> Hi, i would like to seek some help in using the text search. It is quite impressive but ive met an issue while using it. Essentially, it seems like mongo text index does not include embedded document. Is that true and would it be supported in the future? Thanks ;)
[15:08:24] <rspijker> kk: the text index is always on a (set of) fields of type (array of) string
[15:08:59] <rspijker> how are you defining your index exactly?
[15:26:12] <kazak1377> hello everybody. I have 1 collection and 2 type of documets there: computer and shops
[15:27:05] <kazak1377> { "_id" : ObjectId("53baaf0a7f50c1bfcab62a47"), "computer" : { "title" : "acer", "ram" : 2, "hdd" : 750, "state" : "new" } }
[15:27:09] <tscanausa> usually you only want one type of document to a collection but ok....
[15:27:25] <kazak1377> {shops:{title: "e-market", computers: [{computer: "apple", qty: 10, price: 2323.12}, {computer: "hp", qty: 15, price: 560.30}]}}
[15:28:00] <kazak1377> how can i find ram of cheapest computer over all shops?
[15:42:33] <kazak1377> i found algorithm, that i need.
[15:43:09] <kazak1377> now i need to know, how to get value from cursor.next() document.
[15:43:24] <kazak1377> how can i do that?
[15:44:11] <cheeser> come again?
[16:52:01] <techminer1> Does anyone know if the http_proxy feature for MMS will eventually be available in the package installed agents? http://mms.mongodb.com/help/tutorial/install-monitoring-agent-from-archive/#optional-configure-the-agent-to-use-a-proxy-server
[18:22:56] <netQt> Hi all. i have a replica set running, my concern is do i need to always check the member to see if it's primary or not before sending write request? because primary can change over time
[18:25:14] <netQt> suppose my primary running in localhost:27017, so i send request to that port, but then secondary in another port can become primary, so now i have to send request to that port
[18:25:25] <netQt> is there a way to automate this?
[18:26:25] <cheeser> the driver should route accordingly.
[18:27:32] <netQt> so i should keep sending request to one of the set and it will map automatically?
[18:28:12] <cheeser> yes
[21:39:17] <blkcat> so there's $ for updating the first array item matched by a query - is there something analagous to update -all- matched array items?
[22:07:16] <cozby> can someone point to a resource that describes to how access replicaset config programmatically. I'm attempting to configure/modify rs.config in a nodejs module
[22:07:33] <cozby> I'm currently looking at this http://mafintosh.github.io/mongojs/
[22:09:14] <cozby> hmm nvm
[22:32:38] <sebastian_o|> hi guys, I'm implementing a RESTful API and in that backend I'm using mongo. It's doing great, I'll love it. One question, the app needs to make queries on objects, what's the preferred way to send the query parameters? in URL encoded or with a POST and send it in JSON? (I've already read about sanitizing the $ character for injection safety)
[22:43:49] <sebastian_o|> too offtopic?
[22:44:27] <sebastian_o|> this guy seems to suggest in slide 35 that one should use URL http://www.slideshare.net/nicolaiarocci/rest-web-api-with-mongodb