PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 27th of February, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:16:05] <dman777> hello
[04:18:18] <dman777> if I have a field pets: [ { "fido": 1231232 }, { "felix": 33423233 } ], could I index pets array? I read about multi-key and compound indexes but didn't see this type of use case in the examples.... and compound index doesn't really even apply to this one
[04:20:57] <dman777> oh wait...just ran across https://docs.mongodb.org/manual/core/index-multikey/#index-arrays-with-embedded-documents
[04:52:45] <dman777> I assume a index on a field with a object id is faster than a indexed string field, correct? If I had a field on user called pets.... pets: [ { name: "fido", ref_objectId: 456564 } ]... would I just createIndex({"pets.name")) to get the object id and look up the pets record by object id?
[05:10:43] <Freman> is it possible to make mongo insert into 2 collections the same data at the same time? ie. one capped/live collection and one that is unique to the month (with the intention of keeping the month around for a couple of months then archiving to disk?) - bearing in mind... I'd rather just write the lot to disk and never use the mongo :D
[05:11:27] <Freman> not that there's anything wrong with mongo just our abuse of it
[05:12:12] <dman777> Freman: you can insert multiple documents at the same time.... one second
[05:12:23] <dman777> Freman: you using node?
[05:12:49] <dman777> since you are using seperate collections you can...
[05:13:29] <dman777> setimmediate(function() { doThis(); doThat() })
[05:14:08] <dman777> there's no write lock since they are on seperate collections
[05:17:02] <dman777> you could also do setimmediate(doThis); setimmediate(doThat) but the former has better perfomance in my experience. Really, though... it these are purely just I/O you can just doThis(); doThat() and they would be non blocking
[05:17:47] <dman777> meaning doThis() is db.collection.insert().... not sure, though, if it's purley I/O...for instance, I use node mongodb driver
[05:34:22] <reduxredux> Hi all, are there any other characters in a fully qualified index name other than database.collection.$indexname ? My mongoimport fails claiming it's greater than 128 chars.. I think it is *exactly* 128 (trivial I know :-/ )
[05:40:24] <reduxredux> Ah, it looks like I'm on the version where the limit was actually 125 :(
[10:54:29] <synthmeat> mongoose stopped making pool of connections for me :/
[10:54:32] <synthmeat> i just get one
[11:14:14] <synthmeat> reported @ https://github.com/Automattic/mongoose/issues/3920
[16:00:52] <Axy> I'll be udating my mongodb from 3.0.7 to the latest, I've realized that a lot changed
[16:01:07] <Axy> so I assume it won't be a seamless transition for my nodejs bsed app right?
[16:01:25] <Axy> Will I have to re-write the parts that use, for instance, findAndModify?
[16:10:51] <StephenLynx> that is up to the driver.
[16:11:10] <StephenLynx> that driver may have some issues, but breaking backward compatibility is not one of them.
[16:11:17] <StephenLynx> dont worry.
[16:11:55] <Axy> StephenLynx, I'm using the native nodejs driver
[16:12:02] <Axy> so everything should work as they do before?
[16:12:15] <StephenLynx> yes.
[16:12:17] <Axy> Hmm
[16:12:29] <Axy> with the latest update of the driver I assume right?
[16:12:33] <StephenLynx> yes.
[16:12:37] <Axy> okay thank you!
[16:12:39] <StephenLynx> np
[16:14:41] <Axy> StephenLynx, I also would love to know how I can update mongodb, I2m on ubuntu
[16:15:43] <StephenLynx> apt-get -y dist-upgrade?
[16:15:47] <StephenLynx> depends on how you installed it.
[16:15:56] <StephenLynx> with centOS I just run yum -y distro-sync
[16:16:30] <Axy> hmm
[16:28:11] <dddh> Axy: from 3.0.7 to latest stable ?
[16:28:17] <Axy> yeah dddh
[16:28:33] <Axy> I tried to do it with https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ this page
[16:28:43] <Axy> sudo apt-get install -y mongodb-org
[16:28:49] <Axy> this command didn't seem to update anything
[16:28:55] <Axy> so I've installed all four components manually
[16:29:01] <Axy> now when I do mongo --version I see 3.2.3
[16:29:13] <Axy> this should be it right?
[16:29:25] <StephenLynx> yes
[16:29:32] <StephenLynx> that is for your terminal though
[16:29:42] <StephenLynx> connect to a db and run db.version()
[16:29:47] <StephenLynx> that will give the server version
[18:06:42] <Axy> I'm trying to use deleteOne with mongodb nodejs api
[18:06:47] <Axy> but I can't succeed to delete with _id
[18:08:18] <Axy> myColl.deleteOne({_id:56d1b52235f329d53b7dac69}, function(err,r){})
[18:08:26] <Axy> this is what I do
[18:08:30] <Axy> I've tried this as well:
[18:08:36] <Axy> myColl.deleteOne({_id:"56d1b52235f329d53b7dac69"}, function(err,r){})
[18:08:40] <Axy> both didn2t work
[18:08:43] <Axy> am I missing something
[18:22:34] <Axy> did they kill .remove?
[18:22:41] <Axy> and replaced it with .deleteOne and .deleteMany?
[18:34:34] <StephenLynx> Axy, the _id
[18:34:37] <StephenLynx> you passed a string
[18:34:44] <StephenLynx> instead of an ObjectId object.
[18:34:49] <StephenLynx> so it didn`t match.