[03:38:33] <Frenchiie> does doing an update on a document mean it has to find the match every time? is there a way to keep a reference to a document once you find it?
[03:38:46] <Frenchiie> so that an update to it doesn't mean having to go through the collection to find it
[03:41:05] <Frenchiie> not sure if i'm looking for indexing
[05:55:32] <dddh> kurushiyama: btw I used luamongo
[05:55:54] <dddh> do not like that there are no prebuilt packages for lua mongo clients in current distros ;(
[05:56:04] <dddh> playing with mongorover: "...ua/luarocks/share/lua/5.2/mongorover/MongoCollection.lua:100: No suitable servers found (`serverselectiontryonce` set): [connection error calling ismaster on '10.14.243.131:27017']"
[12:12:28] <Ange7> kurushiyama: i want insert doc but i don't want wait that insert is finished, i want my code continue,
[12:12:44] <Ange7> (sorry for my english, i'm french)
[12:13:19] <kurushiyama> Ange7 Well, I am German ;) Well, you have serval options here.
[12:13:44] <kurushiyama> Ange7 Option 1: reduce the write concern (maybe not ideal, depending on your use case).
[12:14:34] <kurushiyama> Ange7 Option 2: Use an async driver, which depends on your language if such is available
[12:14:50] <Ange7> kurushiyama: i have min 1500 insert / sec
[12:15:04] <Ange7> kurushiyama: actualy i'm using PHP Driver
[12:15:12] <kurushiyama> Ange7 You have or you plan to have?
[12:16:13] <kurushiyama> Ange7 Option 3 Spawn a thread (I have no clue how to do that in PHP nor wether this is even possible) and have the thread to the insert.
[12:17:28] <kurushiyama> Ange7 So how does your backend look like? How many frontends do you have? Can / Do you use bulk inserts?
[12:18:12] <kurushiyama> Ange7 What is your writeConcern? What are the problems you experience?
[12:18:18] <Ange7> kurushiyama: found on stackoverflow http://stackoverflow.com/questions/19813713/are-mongo-php-write-operations-sync-or-async PHP Driver can write in async
[12:18:38] <kurushiyama> Ange7 There you have your solution... Sorta.
[12:21:44] <kurushiyama> This has serious implications.
[12:23:49] <kurushiyama> Ange7 A write concern of w=0 actually means that your writes will go unacknowledged.
[12:25:20] <kurushiyama> Ange7 Only network and socket exceptions will be returned. To make a long story short, you can not be sure that the write will be accepted. For example, duplicate key errors and alike are _not_ returned.
[12:27:28] <kurushiyama> Ange7 By all means, unless your data is extremely cheap (easy to reobtain), I would _not_ suggest lowering the write concern below 1. More often than not, I even suggest a higher write concern.
[12:31:12] <Ange7> i don't think it's a problem for my usage
[12:35:00] <kurushiyama> Ange7 Only you can decide that.
[12:43:24] <kurushiyama> dddh__ He pmed me. Will do that later. I just wonder how ops work, nowadays. Not using LVM for a dedicated partition of highly volatile and potentially growing data is... ...dangerous.
[15:23:31] <jetole> Hey guys. Is there a way for me to set multiple users in mongorc and have it auth with the credentials for the specific server depending on what server I am connecting to?
[16:20:24] <macwinne_> saving 80% on storage. and more importantly went down from 6GB of ram for indexes to 1.2GB.. that's quite a unexpected, yet pleasant, benefit.. not sure why it's not talked about more
[16:20:37] <macwinne_> prefix compression is awesome
[16:37:47] <kurushiyama> macwinne_ There is a subtle thing to keep in mind, though. All those compressions make your instance rely on CPU more than you are used to with MMAPv1
[16:38:13] <cheeser> a CPU below 100% usage is a waste of money :D
[16:39:04] <kurushiyama> Well, I'd say 85%, since you want to have time to scale.
[16:39:10] <macwinne_> cheeser: I was asking this on the weekend.. not sure if you know. Is there an easy way to tell if an index is actually being used without having access to the application code?
[16:39:57] <macwinne_> if I'm just mongo dba, and i don't have time to deal with devs who may be changing queries.. i want to keep an eye out on unused indexes that are unnecessarily eating memory
[16:42:37] <StephenLynx> yeah, I never heard of a tool like that.
[16:43:06] <kurushiyama> There isnt. I answered him originally, and I took quite some time to research.
[16:43:17] <StephenLynx> you have 2 options: inspect the log and look for a pattern on queries and compare to the existing indexes
[16:43:27] <StephenLynx> or inspect the source code.
[16:43:58] <StephenLynx> if I were you, I would just take a look on the existing indexes, see the most resource intensive ones and see if they are actually needed.
[16:44:24] <StephenLynx> if its an index that is unnecessary but isn't a big deal, it might not be worthwhile to try and eliminate it.
[16:50:26] <kurushiyama> In general, an since we are repeating this discussion I have the urge to restate it for completeness: I think this is looking for a technical solution for a non-technical problem, namely lack of communication and proper database change management.
[16:52:57] <cheeser> like how to manage indexes :)
[16:55:25] <kurushiyama> We once hit the RAM barrier with a cluster and asked dev to recheck their indices, since some of them looked very odd (indices over non-existing fields and such). They admitted they lost overview. We dropped all indices.
[16:55:48] <kurushiyama> Well, all we could drop ;)
[16:56:28] <kurushiyama> However, we were nice and did it in the morning.
[17:05:11] <saml> hey, what characters can't be used as key of object? dot right?
[17:06:15] <saml> Field names cannot contain dots (i.e. .) or null characters, and they must not start with a dollar sign (i.e. $). See How does MongoDB address SQL or Query injection? for an alternate approach.
[17:12:08] <kurushiyama> Was just about to say that. And you usually need the emails for a given mailing list, like db.subscriptions.find({list:"bar@baz.com",unsub:false},{_id:0,email:1})
[17:12:09] <saml> one doc per {email, vendor, listname}
[17:12:30] <StephenLynx> yeah, but you won't have that many newsletters
[17:12:32] <saml> .find({email:email}) will give me all subscribed lists
[17:19:27] <kurushiyama> saml No. Store the subscriptions flat. db.subscriptions.insert({email:"subscriber@foo.com", list:"sender@bar.com"}) for example.
[17:20:45] <StephenLynx> I just said it doesn't have to be on that case.
[17:20:55] <StephenLynx> he doesn't have to fetch all that aditional data frequently
[17:20:58] <saml> this is for a web page where a user with an email can subscribe/unsubscribe to a bunch of mailinglists by clicking checkboxes and submit
[17:21:17] <StephenLynx> which they won't do often.
[17:21:21] <kurushiyama> saml Been there, done that. For KISS (Keep It Simple and Scalable), a flat model is good enough.
[17:21:29] <saml> so, StephenLynx 's model is good so is kurushiyama
[17:36:01] <kurushiyama> This is roughly how I solved it.
[17:36:47] <kurushiyama> The thing is that the most common use case is "Get all non-suspended subscribers to a _given_ newsletter_"
[17:39:04] <kurushiyama> Instead of putting the list name into "subscriptions", it may be viable to even put the email in there. In that case, one query is saved, for very simple mailinglists. Personally, I needed some list metadata to process, hence I had one query for the list and one for the subscribers per incoming mail.
[17:48:59] <kurushiyama> saml Had some smoked turkey sandwiches with home made mayonaise, salad and fried onions.
[18:00:39] <kurushiyama> saml Hope my solution helps you for your use case.
[18:04:25] <saml> let me chekc. thanks kurushiyama , the good cook and mongodb expert
[18:05:23] <kurushiyama> saml You are very kind, but both labels are slightly beyond the truth ;)
[19:30:45] <ing8> hi guys. I need a help on pymongo
[19:30:47] <ing8> I need to copy like 7kk rows from one mongo collection in one server to another mongo collection on another server. I cannot place result in the variable because I dont have enough mem and slices and limit/skip kinda slow at 10000 already. What is the best way to do this?
[19:43:14] <StephenLynx> get a cursor and consume document by document.
[21:34:00] <uuanton> if I have just primary without secondaries and in connection string secondaryPreferred would it still be able to deliver if I have no secondaries ?
[21:36:13] <Derick> uuanton: you mean you have a one-node replicaset?
[23:15:49] <Echo6> I know the basic command of db.mycollectionname.count()
[23:48:05] <MacWinner> i want to eventually move to a mongo sharded cluster.. i currently have a 3-node replicaset with about 4 application servers talking to it. Should I spin up mongos instances and have my apps talk to mongos as the intermediary before moving to the sharded cluster?
[23:48:39] <MacWinner> i want to minimize the number of changes I do at the time of actually sharding.. so i thought getting the application architecture to talk to mongos completed first may be prudent
[23:49:34] <MacWinner> basically questin is does mongos require an actual sharded cluster, or can it talk to a simple replicaset and then automatically talk to a sharded cluster once it's configured