PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 17th of January, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[10:56:04] <jost> Hi! I want to insert something into the database, but if the _id already exists, I want an exception. Doing 2 queries (checking for existence, then updating) may go wrong because of concurrency. Just inserting should just work, and fail if the _id-value is already there, on any shard?
[10:57:59] <jost> (I'm using spring datas mongodb adapter, if that matters)
[13:04:46] <bakhtiyor> does mongodb _id field required objectid type or doesn't matter? i want to store 12-byte hex string
[13:05:13] <kali> bakhtiyor: that will be fine
[13:05:17] <bakhtiyor> what are disadvantages using this approach?
[13:06:03] <bakhtiyor> i meant storing "507f191e810c19729de860ea", but not ObjectId("507f191e810c19729de860ea")
[13:06:36] <bakhtiyor> kali: did you get my point?
[13:07:19] <kali> bakhtiyor: yes. it will take a bit more of space, indexing will be slightly more expensive are your key will me longer
[13:07:22] <kali> but that's about it
[13:07:34] <kali> bakhtiyor: i assume you're aware _id can not be changed too
[13:10:16] <kali> bakhtiyor: you can also consider using a Binary. it will be as compact as ObjectId, with no assumption on the actual content (or length)
[13:10:48] <bakhtiyor> kali: thanks, still more disadvantages with string?
[13:10:50] <kali> bakhtiyor: finally, there is something nice about objectid: they start by a timestamp. sometimes it's nice to get a free "creation date" ordering
[13:11:37] <kali> bakhtiyor: i don't think so
[13:12:33] <kali> bakhtiyor: what do you want to know :P
[13:17:34] <bakhtiyor> kali: something which i'll drop about storing string from my mind ))
[14:59:48] <asarch> In a clean environment, why is 'journal' so big (3.5 GB)?
[14:59:57] <asarch> Is it "normal"?
[15:00:34] <asarch> I am using mongodb-server in Debian 8 for AMD64