PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 20th of October, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:01:20] <symbol> Are there any mongodb checklists before deploying?
[02:01:34] <symbol> Despite all the reading, I feel like I might be missing something.
[02:02:37] <StephenLynx> what do you mean?
[02:14:03] <symbol> StephenLynx: It'd be unfortunate if I forgot some sort of auth setting or write concern.
[02:15:00] <StephenLynx> the defaults are sane.
[02:15:26] <symbol> Music to my ears.
[02:15:31] <StephenLynx> by default no external IP can connect and the default WC is what you wish to use mostly.
[02:15:44] <symbol> Wasn't there a major auth issue awhile back?
[02:15:50] <StephenLynx> no.
[02:15:58] <StephenLynx> you have to mess around to screw up, like allowing external connections but not enabling auth.
[02:16:21] <StephenLynx> by default it doesn`t have auth, but since by default only localhost can connect, thats not an issue.
[02:16:36] <symbol> Ah, ok.
[02:17:37] <StephenLynx> what happened is that some dude found out that some people are dumb enough to screw up that and then made lots of noise blaming mongo.
[02:17:58] <StephenLynx> and put out some stupid number but I really doubt the numbers are correct.
[02:18:00] <symbol> Heh, that'd be a good ELI5 for that post.
[02:18:06] <StephenLynx> ELI5?
[02:18:28] <symbol> explain like I'm 5
[02:19:00] <StephenLynx> http://www.information-age.com/technology/security/123459001/major-security-alert-40000-mongodb-databases-left-unsecured-internet
[02:20:29] <StephenLynx> "Readers who are concerned about access to their systems are reminded of the following resources: the most popular installer for MongoDB (RPM) limits network access to local host by default"
[02:20:40] <StephenLynx> tl,dr: pebcak
[02:21:30] <symbol> I tend to err on the side that I'm being naive when reading those articles.
[02:21:43] <symbol> Still learning how servers work and what not.
[02:22:20] <StephenLynx> servers are just computers.
[02:22:27] <StephenLynx> lesson #!
[02:22:29] <StephenLynx> 1*
[02:22:46] <StephenLynx> the internet doesn`t work much differently than a lan
[02:22:49] <StephenLynx> lesson #2
[02:23:13] <symbol> Well, that's a start
[02:26:29] <StephenLynx> oh, btw
[02:26:41] <StephenLynx> if you can`t root on the server, you shouldn`t pay for said service
[02:26:44] <StephenLynx> lesson #3
[02:29:09] <symbol> Ah, that I knew.
[03:27:08] <jzp113> hi guys ,who invent the monogodb?
[03:42:41] <symbol> 10gen
[04:04:51] <terabyte> hey
[04:10:17] <terabyte> I have a mongodb instance whose performance appears to be slow. If this was relational i'd look at indexes, but this is doc based so.. Each document contains an "inventoryId" which is not unique, but every query ever made to the collection must provide at least this id. in addition to this, a query may provide other attributes to look up on (color, country) etc. queries are always of the "x=y"
[04:10:17] <terabyte> form, and never use inequalities... however the set of additional attributes they might query on is up to the user.. they might have all or some or none... given this would creating an index on the mandatory field inventoryId be useful in improving performance?
[04:13:37] <terabyte> so in short, would creating a single field index on inventoryId assist with the performance of queries such as "inventoryId=1&additionalField=2428"
[04:18:25] <joannac> terabyte: yes
[04:20:34] <terabyte> presumably for this it's best to have a hashed index yes? (because we do equality checks and nothing else)
[04:20:46] <terabyte> even if i'm not sharding my mongodb instances
[04:26:42] <Boomtime> terabyte: why would hashed be better?
[04:27:11] <Boomtime> hashed is useful to create a smooth distribution, which might be important under specific conditions
[04:27:39] <terabyte> I'm not sure, I thought hashed would be better because whenver a search takes place it will be performed under some subportion of the data.
[04:27:42] <Boomtime> for sharding a uniform distribution in the key is the easiest way to ensure balance
[04:28:03] <Boomtime> .. that doesn't really explain why hashed is better
[04:28:12] <terabyte> inventoryid is definitely not evenly distributed (there are more '100's than there are 275's for example)
[04:28:27] <Boomtime> i can't see any reason to use a hashed index from what you've said so far
[04:28:45] <terabyte> so I should just use a regular index?
[04:28:45] <Boomtime> do you need a uniform distribution for some purpose?
[04:28:57] <Boomtime> i would say just use a regular index
[04:29:08] <terabyte> i'm not doing anything fancy like sharding the instances for example
[04:29:39] <Boomtime> if you hash the index, you also lose the ability to do range queries - like "everything higher than X"
[04:29:49] <terabyte> just thought if i'm not doing a range query on that field, (and only equality) then i should use hash.
[04:30:15] <Boomtime> it probably won't make any difference for what you've said so far
[04:30:19] <terabyte> ok cool
[04:35:16] <terabyte> what's a typical time for an index to be created in the foreground if the data is about 10gb large (on an ssd) with 1gb memory. we talking 10 minutes or 10 hours?
[04:39:37] <terabyte> 4 minutes apparently :)
[04:39:55] <Boomtime> .. good, was about to say, i'd be surprised if wasn't around 10 minutes
[04:40:07] <Boomtime> also, depends a lot on the data
[04:40:42] <terabyte> holy **** this is fast
[04:41:18] <terabyte> wow...... I was waiting like 2 minutes for data before. now it's .. probably near instant since it's going to the US and back...
[04:41:23] <terabyte> thanks so much
[04:42:20] <Boomtime> yeah, indexes, they're a good idea
[04:43:26] <terabyte> so if the index is only 500mb large, then does that mean a 1gb host should be sufficient for my data?
[04:43:47] <terabyte> (indexSizes, _id_ 700mb, inventoryId: 500mb)
[04:53:28] <Boomtime> depends on your queries now - if you hit a fair range of your data then much of the index will be required to be present in ram to be efficient
[05:03:54] <joannac> indexes are also not magic, if you want to return the document, the entire document still has to go into memory
[05:04:23] <joannac> so if you only have enough for indexes and not your working set, you're still going to be page faulting like crazy
[08:06:06] <adus> Hello guys
[08:12:07] <terabyte> thanks joannac
[08:27:21] <adus> hello guys
[08:27:28] <adus> can someone please help me
[09:13:42] <Mattias> adus: Without a question to be answered nobody can help you.
[09:41:52] <dddh> hm, seems like there are no function based indexes in mongo
[09:42:22] <vagelis> Replacing (Pymongo) with empty filter means that query matches any document?
[09:42:41] <vagelis> Or updating in mongodb..
[09:55:00] <dddh> vagelis: update_many vs update_one https://docs.mongodb.org/getting-started/python/update/
[09:57:40] <vagelis> Well it doesnt say if empty filter means replaces whatever document finds first but i guess it works the same like find({}) which returns all documents
[09:57:58] <vagelis> So it matches all documents
[10:03:16] <adus> Sorry guys .. I was away :(
[10:03:36] <adus> the problem is I have many int float values in the result JSON format
[10:03:52] <adus> need some way to insert all those records to mongo
[10:04:28] <adus> when I am inserting it directly pymongo giving error saying that 8 bit int is only possible
[10:04:46] <adus> someone please give me a solution
[10:06:31] <adus> my solution to the problem was to convert all those int to string using a loop .. but that is the worst way
[10:06:56] <adus> it will take more time .. also the data which I wanted to handle may change
[10:09:11] <adus> guys ??
[12:03:48] <adus> hello
[12:03:56] <adus> I am gettting error
[12:03:58] <adus> OverflowError: MongoDB can only handle up to 8-byte ints
[12:04:06] <adus> any way to avoid this
[12:14:39] <StephenLynx> use ints no larger than 8 bytes
[12:19:10] <adus> see
[12:19:19] <adus> that understood that
[12:19:47] <adus> but I am working on bigdata
[12:20:03] <adus> and I have a JSON file which is always changing
[12:20:19] <adus> and there are a lot of int and float values in that
[12:20:38] <adus> I think changing all the key: values to string will resolve this problem
[12:20:46] <StephenLynx> just how large is this number?
[12:20:54] <adus> but is there any way to do it automatically from mongo
[12:21:01] <adus> 3743277183
[12:21:08] <adus> 24.905599999999993
[12:21:13] <adus> values like this
[12:21:25] <adus> I am using pymongo
[12:21:55] <StephenLynx> if the number fits in a 64 bit int, you could use that
[12:22:04] <StephenLynx> these don't look that big
[12:22:14] <StephenLynx> the first one is what, a few billions?
[12:23:00] <adus> yes
[12:23:09] <adus> these are not looking really big
[12:23:15] <adus> but still mongo is giving error
[12:23:32] <StephenLynx> because they are more than 8 bytes on a 16 bit int.
[12:23:41] <StephenLynx> or 8 bit? I don't know what the default it.
[12:23:44] <StephenLynx> is*
[12:24:24] <Derick> Mongo's Int64 type is 8 bytes
[12:24:36] <Derick> (that's 64 bit)
[12:25:08] <StephenLynx> but does it automatically uses the proper int type of the it doesn't fit the default?
[12:25:13] <Derick> so you need to find which values are higher than that. Converting them to a string might work, but then you can't do calculations with them
[12:25:26] <Derick> StephenLynx: the driver should pick either Int32 or Int64 automatically
[12:25:29] <StephenLynx> ok
[12:25:40] <Derick> but it shouldn't change it to a float (as that could mean data loss in precision)
[12:25:41] <StephenLynx> then scrap what I said v:
[12:25:43] <adus> see this
[12:25:44] <adus> 16043567643241620437
[12:25:49] <adus> this one gave me an error
[12:25:50] <Derick> that's too high I think
[12:25:54] <StephenLynx> yeah
[12:26:07] <adus> this is the specific one which gave error
[12:26:09] <Derick> 9223372036854775807 is the highest you can store (2^63-1)
[12:26:16] <adus> hmm
[12:26:17] <Derick> adus: what do those numbers mean?
[12:26:21] <adus> what do you think ?
[12:26:29] <StephenLynx> space stuff?
[12:26:34] <adus> yes
[12:26:37] <StephenLynx> :v
[12:26:40] <StephenLynx> i R smart
[12:26:42] <adus> red shift
[12:26:50] <adus> and distance to stars
[12:27:07] <Derick> i doubt we know the distance to a star that accurately :-)
[12:27:23] <Derick> in which case, you can probably use a floating point number
[12:27:35] <StephenLynx> don't space stuff use things like "this number multiplied by ten at X potency"?
[12:27:55] <StephenLynx> so you can just store the amounts of zeros?
[12:27:56] <Derick> StephenLynx: which is what a floating point number is really (with some interesting bases)
[12:28:08] <Derick> no need to come up with your own algorithm there
[12:28:11] <adus> how about storing this as strings
[12:28:23] <StephenLynx> then you won't be able to calculate stuff
[12:28:24] <Derick> adus: then you can't do range queries, or calculations with the numbers
[12:28:27] <adus> so that I can convert this to in at anytime from python
[12:28:34] <StephenLynx> however
[12:28:38] <StephenLynx> there is a middle ground
[12:28:46] <adus> I dont have to do calculations from database
[12:28:46] <StephenLynx> when I had to store ipv6
[12:28:53] <StephenLynx> I had to store 128bit ints
[12:29:00] <StephenLynx> which can't be handled by mong
[12:29:04] <adus> what did you do for that ?
[12:29:07] <StephenLynx> so I stored an array of ints instead.
[12:29:14] <adus> :D
[12:29:21] <adus> sounds good
[12:29:32] <adus> but why can't we go for string
[12:29:38] <StephenLynx> you could
[12:29:47] <StephenLynx> but then you will lose a lot of capabilities of ints.
[12:29:52] <adus> but the only problem is I have no clear idea about the JSON
[12:29:53] <Derick> adus: then you can't do range queries, or calculations with the numbers
[12:29:56] <adus> that will keep on changing
[12:29:59] <StephenLynx> if you are sure you will NEVER need these, then go for it.
[12:30:29] <adus> but there comes the problem
[12:30:38] <Derick> I'd probably detect it in python, and if the number is < int64, use a float
[12:30:43] <adus> looping though JSON is a problem
[12:30:43] <Derick> erm
[12:30:47] <Derick> I'd probably detect it in python, and if the number is > int64, use a float
[12:30:50] <Derick> adus: why?
[12:30:51] <adus> how can we do it
[12:31:18] <Derick> you go from JSON first to some Python value I believe?
[12:31:26] <Derick> a dictionary I suppose you call that
[12:31:42] <adus> the JSON file we are talking about is too big
[12:31:50] <adus> any operation in that take a long time
[12:31:54] <adus> :(
[12:32:00] <Derick> how do you import it now then?
[12:32:17] <StephenLynx> id use the same thing for all numbers
[12:33:38] <adus> the json output we get is from a device
[12:33:54] <adus> its haivng some strings some ints some float and lists and so on
[12:34:30] <adus> soemtimes some new keys and values will be there in the dicitionary
[12:34:50] <adus> so its almost difficult to do a search and string(hardcoded[][])
[12:35:05] <adus> we can't use hardcoded key names
[12:35:10] <adus> is there any other way
[12:35:21] <adus> something like converting everything from mongo
[12:35:36] <adus> or converting the whole key:value of json to string
[12:36:13] <Derick> in PHP you can just do foreach(json_decode($jsonString) as $key => $value) { if (is_numeric($value)) { ... } … }
[12:36:24] <Derick> doesn't python have a dict looping method?
[12:37:02] <adus> we will have to go for a reccursive looping
[12:37:13] <adus> which is bad
[13:11:51] <dhanasekaran> Hi Guys, I am getting Error : Failed with error 'chunk too big to move', from shard0000 to shard0001 how to fix this please guide me
[13:13:00] <cheeser> start here https://docs.mongodb.org/manual/core/sharding-chunk-migration/#jumbo-chunks
[13:13:56] <Zelest> how many servers are required for sharding?
[13:25:44] <pamp> How can I fetch documents by field type?
[13:26:52] <Derick> pamp: find( { foo: { '$type' : <typeID> } }); IIRC
[13:27:12] <pamp> db.Ericsson3GVertex_20151012.find({_id:{$type:3}})this query return 0 results
[13:27:16] <Derick> https://docs.mongodb.org/manual/reference/operator/query/type/?utm_source=buffer&utm_campaign=Buffer&utm_content=buffer99c66&utm_medium=facebook
[13:27:35] <pamp> but all _id are type 3
[13:27:35] <Derick> most _id fields should be type 7
[13:27:43] <dbh> currently i have a replica member syncing from another replica member and i'm curious if there is a way to get a sense of the progress
[13:28:03] <Derick> pamp: where did you get the type numbers from?
[13:28:22] <pamp> var t = db.Ericsson3GVertex_20151012.findOne() => t._id BinData(3,"MZL8eLK4rUGR437ySvR6/A==") => t._id instanceof Object true
[13:28:24] <Derick> dbh: iirc, it's in the secondary's log file
[13:28:30] <Derick> ah
[13:28:35] <Derick> that instance of is JavaScript
[13:28:45] <Derick> BinData is type 5
[13:28:55] <pamp> hmm ok
[13:28:58] <pamp> thanks
[13:28:59] <Derick> as per https://docs.mongodb.org/manual/reference/bson-types/
[13:29:05] <pamp> i will try
[13:30:21] <dbh> Derick: thanks - i will check that out
[13:31:15] <dbh> in rs.status() i wasn't certain if there was a way to understand these values and compare them...
[13:31:18] <dbh> "optime" : Timestamp(1445154706, 18)
[13:31:21] <dbh> "errmsg" : "still syncing, not yet to minValid optime 5625ec61:5"
[13:32:33] <dbh> Derick: i should have checked the log awhile ago ... i think i am getting errors that i'm not certain how to resolve
[13:32:51] <dbh> Derick: [rsBackgroundSync] replSet not trying to sync from mongo7:27017, it is vetoed for 181 more seconds
[13:33:28] <dbh> Derick: does that mean it is not currently even syncing? --- trying to google for that but not having luck finding actionable info
[13:38:21] <golya> Hi, how can I sort arrays? When I try to sortsort: [['ip.0', 'asc'],['ip.1','asc']]
[13:38:37] <golya> it compains: Error: cannot index parallel arrays
[13:38:58] <StephenLynx> I don't think you can sort sub-arrays.
[13:39:02] <StephenLynx> but I am not sure.
[13:39:17] <Derick> dbh: sorry - don't know :-/
[13:39:27] <StephenLynx> or are you talking about sorting by the sub-arrays?
[13:40:43] <golya> I have array property, and would like to sort it
[13:41:03] <StephenLynx> sort the array itself or the documents that contains the array?
[13:41:40] <golya> ok, query and sort the collection based on the array value
[13:43:24] <StephenLynx> ah.
[13:43:29] <StephenLynx> what language are you using?
[13:43:37] <StephenLynx> that syntax you showed me is very weird.
[13:43:50] <golya> javascript (meteor)
[13:43:58] <StephenLynx> usually I sort in js using .sort({field:1})
[13:44:00] <StephenLynx> or -1
[13:44:04] <StephenLynx> meteor is crap.
[13:44:08] <StephenLynx> I recommend not using it.
[13:45:42] <cheeser> but you say that about everything so it's hard to take it too seriously. :)
[13:46:06] <StephenLynx> I don't.
[13:46:33] <StephenLynx> I think node is a great runtime environment for example.
[13:46:39] <stondo> hi all
[13:46:47] <StephenLynx> its just that I don't bother shilling for good stuff.
[13:46:52] <cheeser> heh
[13:46:58] <golya> So, ignoring the fact that I'm using meteor, how can one sort by an array property 'naturally'
[13:47:22] <StephenLynx> sort({'array.piece':1})
[13:47:37] <StephenLynx> sort({'array':1})
[13:47:46] <stondo> I created a replica set with 2 Linode servers, and I expected that secondary node would become primary if primary failed, but it doesn't work like that
[13:47:56] <golya> then either it does not work, or meteor is crap :)
[13:48:01] <stondo> is it possible to achieve that with only 2 servers setup?
[13:48:02] <Derick> stondo: no, you need 3 nodes for that to work
[13:48:10] <golya> array is the name of the property, which has array values, right?
[13:48:15] <StephenLynx> yes
[13:48:15] <Derick> stondo: or, 2 nodes, and an arbiter
[13:48:41] <Derick> stondo: a majority (>50%) needs to be up for failover to work
[13:48:53] <stondo> Derick, thx. The arbiter server can be less powerful that the mongo ones?
[13:48:54] <Derick> stondo: one out of two, is only 50%, and not >50%
[13:48:58] <Derick> stondo: certainly
[13:49:26] <stondo> Derik, I'm not sure I can pich the right machine for being an arbiter
[13:49:37] <Derick> what are the options?
[13:49:43] <stondo> I bought 2 $160 Linode plan
[13:49:57] <StephenLynx> daium
[13:50:05] <Derick> I don't know how Linode's plans work, so you need to provide a link
[13:50:17] <StephenLynx> their basic plan is like, 10 bux
[13:50:27] <stondo> Derik: https://www.linode.com/pricing
[13:50:54] <Derick> the 16GB ones?
[13:51:03] <stondo> I got 2 of those, yes
[13:51:20] <StephenLynx> i hear that people use a cheaper server as an arbiter
[13:51:27] <Derick> ok, I think a 1GB one, perhaps a 2GB one would work fine for arbiter
[13:51:43] <Derick> StephenLynx: that's what I was trying to get at
[13:51:51] <StephenLynx> ninja'd
[13:51:52] <StephenLynx> v:
[13:51:58] <StephenLynx> also, I failed at reading
[13:52:59] <Derick> stondo: it depends a little on whether they calculate internal data centre traffic under their caps...
[13:53:48] <stondo> Derick, I think that if I use private network, perhaps bandwidth won't be affected, but I have to check with Linode support to make sure
[13:54:01] <stondo> Derick, thx for your help
[13:54:32] <Derick> np, and good luck
[13:54:59] <Derick> stondo: also wise to check to make sure you use private network for the replication then
[13:55:26] <Derick> and to check that the replication configuration uses externally accessible IPS (if your client is outside of their private network)
[13:58:10] <dbh> Derick: np, thanks :)
[14:37:00] <the_german> hi @ all. I have a lot of documents with arrays of geopoints (they are pretty much traces of some drive with a car). I want to use a 2dsphere index. Is there a elegant way to determine wether any of the geo-points lies within some defined geofence without iterating over all of the items in the array?
[14:37:50] <Derick> before or after import?
[14:39:52] <the_german> Derick: After import. I have to do queries for multiple geofences
[14:40:10] <Derick> you can do queries to see whether points are within a polygon
[14:40:21] <Derick> or rather, multiple polygons too
[14:41:05] <Derick> the_german: the first example at http://derickrethans.nl/big-polygon.html
[14:41:08] <Derick> shows how to (in PHP)
[14:41:27] <the_german> Derick: Yes I know that. And also within a circle etc. right? But I need to find out whether at least one point of a array is within the polygon e.g.
[14:41:39] <the_german> Derick: allright give me a sec
[14:42:28] <Derick> an array? what does your data look like? each document one GPS trace? and you want to find out which or your documents (with single GPS trace) has a point within a geofence (polygon/circle)?
[14:42:55] <the_german> Derick: I already found that link. But in this example they only have one geo point. I have multiple and need to check if at least one of them is in there. Is there a function in mongo that supports that or do I have to do that for every element of the array with e.g. $elemmatch
[14:43:14] <Derick> the_german: can you show me a document?
[14:44:47] <the_german> Derick: Unfortunatly not right now from my actual installation but...
[14:44:49] <the_german> Derick: http://geojson.org/geojson-spec.html
[14:44:59] <Derick> I know how GeoJSON looks like
[14:45:06] <the_german> Derick: I have for every document just something like a coordinate array
[14:45:18] <Derick> I would like to see an actual document that you use, to see how it looks like. And explain how to do the query.
[14:46:14] <the_german> Derick: I can't give you that right now but I'll try. Can you tell me if there is an easier way than iterating over the array?
[14:46:47] <Derick> i can't tell without seeing a document
[14:46:54] <Derick> so many ways of storing this
[14:51:20] <the_german> Derick: Ok i need a minute
[14:54:25] <the_german> Derick: http://pastebin.com/UakY4EX5
[14:56:45] <kba> My server just restarted and suddenly mongodb wouldn't start, I was getting "[initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating"
[14:56:46] <Derick> the_german: you should store it as a GeoJSON LineString really
[14:57:20] <Derick> and then you can use an intersect query
[14:57:26] <kba> I don't recall if I've rebooted the server since I installed mongodb, but either way I found /etc/mongodb.conf and it says: storage: dbPath: /var/lib/mongodb
[14:57:45] <kba> and in /var/lib/mongodb, the databases are definitely located
[14:57:57] <krion> hello
[14:58:16] <kba> so why is it that when I do "sudo monogod", it looks in /data/db and not /var/lib/mongodb as specified in mongod.conf?
[14:58:24] <the_german> Derick: Yeah I will convert it into GeoJSON LineString. But isnt the intersect query on one specific geo point only?
[14:58:33] <cheeser> because you're not telling mongod to use that conf file
[14:58:46] <Derick> the_german: you want to know which exact point in the line is within the geofence?
[14:59:15] <kba> cheeser: it's just curious that this problem just suddenly appeared now. I've never manually started mongodb before
[14:59:47] <krion> using mongo2.4, i just "switch" mongo primary <-> secondary in a replicaset, the goal is to upgrade from 2.4.9 to 2.4.14
[14:59:47] <Derick> kba: you probably should start it with something akin to "service start mongod"
[15:00:12] <krion> the thing is new secondary is still showing "syncingto" primary
[15:00:26] <krion> the message used to disappear earlier
[15:00:27] <kba> Derick: Indeed, but "sudo service mongod start" just gives "[FAIL] Starting database: mongod failed!"
[15:00:39] <the_german> Derick: Yes eventually. But my question right now is this https://docs.mongodb.org/manual/reference/operator/query/geoIntersects/ . Can loc be in those examples als be a LineString. Yes right?
[15:01:41] <kba> In /etc/init.d/mongod, I can actually even see that it specifies /etc/mongod.conf
[15:01:43] <the_german> Derick: I think you helped me out on the first part. But how do I only get the points within the fence?
[15:01:46] <Derick> the_german: which example exactly?
[15:01:55] <kba> CONF=/etc/mongod.conf, DAEMON_OPTS="-- "${DAEMON_OPTS:-"--config $CONF"},
[15:02:18] <Derick> if you only want the points in a fence then hmm
[15:02:33] <krion> can i have a % of the syncing progress ?
[15:02:48] <the_german> Derick: Tricky I know. I am sorry that I bother you with this
[15:03:17] <Derick> the_german: i am not 100% certain whether you can (in one document) jave an array of GeoJson points work together with a 2dsphere index
[15:03:21] <Derick> jave->have
[15:03:26] <Derick> let me check that
[15:04:50] <kba> Derick: Figured it out. It just seems like it couldn't unlink the sock file. I assume the server crashed and it wasn't cleaned up probably after.
[15:05:53] <Derick> the_german: nope
[15:05:53] <the_german> Derick: Thanks.
[15:05:58] <the_german> Derick: damn
[15:06:14] <the_german> Derick: How would you recommend solving this? Just do it without an index?
[15:06:53] <Derick> so two solutions: 1. you need to store each point in a document; 2. do it in two phases: a $intersect with a LineString and Polygon geofence, and then filter out the points in your app
[15:06:59] <Derick> i don't think it works without index
[15:07:07] <Derick> or if it does, it will be *really* slow
[15:08:51] <the_german> Derick: The second one is actually how I do it right now. First I check with $elemmatch wheter a doc contains any point within the fence. After that i do $unwind on the array. And then filter out all the elements I dont need. At last a repack the array with $group. so I dont have to do it in the app
[15:09:54] <krion> is there an easy way to see the status of a "syncing" replicaset ?
[15:10:08] <krion> except rs.conf and rs.status() i'm not really use to it
[15:15:33] <ksmtk> hi
[15:15:49] <the_german> Derick: Is there a way to store additional information in GeoJSoN
[15:16:00] <ksmtk> need somebody who has experience with geojson + mongoose
[15:16:03] <ksmtk> http://stackoverflow.com/questions/33240313/mongoose-how-to-add-2dsphere-index-on-custom-type
[15:16:19] <ksmtk> any thoughts?
[15:16:39] <Derick> the_german: seems so: http://pastebin.com/ZJYGxWhv
[15:18:06] <the_german> Derick: THIS...IS...AWESOME. Thank you kind stranger.
[15:18:58] <Derick> hehe
[15:20:04] <Zelest> Derick, how many servers do I need at minimum for a sharded environment?
[15:20:34] <Derick> Zelest: minimum for production? 9 + 1 or more application servers
[15:20:48] <Derick> 3 config servers + 2 * (3 node replicaset)
[15:21:06] <Derick> technically you can of course have one shard, but that'd be a bit silly
[15:21:11] <Derick> Zelest: why do you wan to to shard?
[15:21:11] <Zelest> yeah
[15:21:19] <Zelest> atm, I don't.. :)
[15:21:22] <Zelest> but maybe in the future
[15:21:37] <Zelest> your question makes me wonder if sharding is a bad thing?
[15:22:05] <Derick> Zelest: it adds quite a bit of complexity... which is a pain if you don't need it
[15:22:16] <Zelest> ah, true
[15:22:19] <Derick> Zelest: and from exerience I know that most people don't end up needing sharding
[15:24:22] <krion> looks like exactly like https://jira.mongodb.org/browse/SERVER-3616
[15:24:30] <krion> but i'm running 2.1 and not 2.4
[15:26:56] <cheeser> you're running 2.1?
[15:27:55] <StephenLynx> omg
[15:30:01] <krion> no sorry, the other way :)
[15:30:11] <krion> i'm running 2.4 but the bug was fix in 2.1
[15:30:22] <krion> although i've the same behaviour
[15:42:39] <krion> not sure how to know syncing is done
[15:48:29] <ksmtk> mongoimport and mongoose http://stackoverflow.com/questions/33240995/mongoimport-and-mongoose-indexes-are-not-set
[15:48:42] <ksmtk> problems with indexes
[15:52:09] <StephenLynx> mongoose is awful, try without it.
[15:52:39] <christo_m> is there a way to do $push uniquely?
[15:52:43] <christo_m> based on some object property?
[15:53:01] <StephenLynx> hm
[15:53:20] <StephenLynx> are you updating several documents and each one needs a different value?
[15:53:37] <christo_m> StephenLynx: no its an upsert , one at a time
[15:53:40] <christo_m> pushing just one item
[15:54:06] <christo_m> but i want to upsert not only the parent collection but also the array if necessary instead of just blindly pushing new items in
[15:56:26] <christo_m> StephenLynx: not sure if thta makes sense or not
[15:56:34] <StephenLynx> nope.
[15:56:36] <christo_m> but ya, is it possible to $push uniquely
[15:56:41] <StephenLynx> couldn't figure what you want
[15:56:48] <christo_m> i want to $push uniquely
[15:56:53] <StephenLynx> that makes no sense.
[15:57:00] <christo_m> okay right now if i $push javascript objects
[15:57:09] <christo_m> theres no way to tell if im pushing an exact copy
[15:57:16] <christo_m> id like to only $push if the objects differ by some property
[15:57:24] <StephenLynx> $addToSet?
[15:57:26] <christo_m> im not sure how to say it any clearer
[15:57:37] <christo_m> oh does it work just like $push?
[15:58:00] <StephenLynx> no, it won't push if the element is already present on the array you are pushing to.
[15:58:20] <StephenLynx> it has some
[15:58:27] <StephenLynx> intricacies you should read.
[17:46:36] <fullstack> Hello
[17:48:45] <fullstack> Whats the best approach to check database consistency, validate columns, check for missing references, deal with mis-matched JSON structures in a database?
[17:50:30] <StephenLynx> application code.
[17:55:16] <fullstack> Thanks. Yes I think not putting garbage into the database is the best approach, Mongoose.Validate seems to be the best approach
[17:56:11] <fullstack> I'm curious if there are others. Absent of dumping the database, and then piping it through the schema again with a good Mongoose.Validate, then reporting on any validation errors.
[17:57:05] <StephenLynx> don't use mongoose.
[17:57:19] <cheeser> fullstack: 3.2 will offer validations for that.
[17:57:22] <StephenLynx> it is 6 times slower than the native driver and its behavior is extremely flawed.
[17:57:38] <StephenLynx> it doesn't handle ids properly nor dates.
[17:57:41] <StephenLynx> its a clusterfuck.
[17:58:07] <fullstack> StephenLynx, unfortnately I'm a developer onboarded after that decision
[17:58:17] <StephenLynx> welp
[17:58:36] <StephenLynx> you can always just use the native driver and replace mongoose slowly.
[17:59:10] <fullstack> ok, then how do I do schema validation aka equiv of mongoose.validate? manually?
[18:01:36] <fullstack> cheeser, thanks.
[18:01:51] <fullstack> Will future versions of MongoDB support ChangeFeed like rethinkdb?
[18:02:05] <fullstack> basically the same functionality as SQL triggers
[18:02:22] <cheeser> hard to say
[18:03:37] <cheeser> https://jira.mongodb.org/browse/SERVER-124
[18:04:30] <fullstack> so its still best practice to poll the database?
[18:04:58] <fullstack> Wow that feature request is from 2009
[18:05:10] <cheeser> and by eliot so ... :D
[18:06:40] <fullstack> it might as well be from the 70s
[18:06:42] <deathanchor> app layer.
[18:06:42] <fullstack> that 70s query
[18:06:49] <deathanchor> let the db be a db
[18:19:02] <fullstack> recommended mongodb query cheat sheet?
[18:35:34] <StephenLynx> http://mongodb.github.io/node-mongodb-native/2.0/api/
[19:08:49] <symbol> I'm working on paginating based on the date of my blog posts. I'd like to return 25 results per page and then have a "More" button that only gets displayed if there are more in the database. I imagine I can't really do that with the native drive in a single query?
[19:09:32] <symbol> Right now I just pull one more document than I need and show the "More" if it's greater than the number but that generally leaves out the last doc if it's even.
[19:11:56] <StephenLynx> what
[19:12:17] <StephenLynx> what do you mean it leaves the last doc out?
[19:13:44] <symbol> nvm. long day.
[19:13:50] <symbol> I was popping that last one.
[19:24:23] <garyserj> is mongodb's api backward compatible?
[19:24:41] <StephenLynx> what api?
[19:24:59] <garyserj> I mean, when using it from e.g. nodejs
[19:25:18] <StephenLynx> hm, there is a graphic for that somewhere, let me see if I can find it
[19:25:39] <StephenLynx> https://docs.mongodb.org/ecosystem/drivers/node-js/
[19:26:08] <StephenLynx> https://docs.mongodb.org/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-language-node
[19:32:52] <garyserj> so for example the findone function in 1.4 http://mongodb.github.io/node-mongodb-native/1.4/api-generated/collection.html#findone Will that example work in all current versions of mongodb with node?
[19:33:22] <garyserj> and if not, then is that documented anywhere?
[19:34:52] <StephenLynx> no idea.
[19:34:59] <StephenLynx> just roll with the latest driver.
[19:35:08] <StephenLynx> it works on node 4.2.1
[22:26:13] <symbol> StephenLynx: Since you're familiar with node.js - I shouldn't ever see more than one connection in the mongod log right?
[22:32:22] <shoshy> how can i find all documents that their "result" field (which is an array) has an object that his "something" property equals "something else" ?
[22:37:51] <joannac> result.something : "something else"
[22:54:52] <StephenLynx> symbol no, the driver has its connection pool
[23:14:03] <symbol> Ah, that makes sense.
[23:15:44] <StephenLynx> not also, but you will start a new connection pool on each worker.
[23:15:58] <StephenLynx> not to mention*