PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 23rd of November, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:40:18] <ThatTreeOverTher> what are the pros of using GeoJSON
[01:49:17] <darkblue_b> ThatTreeOverTher: ?
[01:49:31] <darkblue_b> pros use geoJSON yes ;-)
[01:49:47] <ThatTreeOverTher> darkblue_b, but why use GeoJSON instead of '2d'?
[01:50:18] <darkblue_b> 2d .. thats not a format, thats short ofr "two dimensions"
[01:50:47] <ThatTreeOverTher> http://docs.mongodb.org/manual/core/2d/ it works with geospatial queries too kinda?
[01:51:02] <ThatTreeOverTher> it is too a format
[02:06:12] <darkblue_b> sorry, on phone
[02:27:54] <r01010010> i have the mongod running, and i can connect from another tool but this code in node.js throws me an error connection!
[02:28:01] <r01010010> https://gist.github.com/r01010010/8b0d8f15a6df101724f7
[02:28:52] <ThatTreeOverTher> r01010010, I personally only know how to use mongoose when working with mongodb (I think it's easier) but what error are you getting?
[02:29:10] <r01010010> Error: failed to connect to [localhost:27017]
[02:30:46] <ThatTreeOverTher> it appears to me that the way you're doing it should work
[02:30:58] <ThatTreeOverTher> at least from the Node perspective
[02:31:57] <r01010010> i don't get this
[02:33:03] <ThatTreeOverTher> one person [1] tried changing "localhost" to "127.0.0.1:27017"
[02:33:05] <ThatTreeOverTher> [1]: http://stackoverflow.com/questions/21507761/mongodb-setup-with-node-js-error-failed-to-connect-to-localhost27017
[02:39:06] <r01010010> i already did that
[02:39:16] <r01010010> and nope :(
[02:39:24] <r01010010> it works with mongoose in a web project
[02:39:30] <r01010010> but this is a command line project... and nothing!
[02:39:47] <ThatTreeOverTher> Command line project?
[02:44:22] <r01010010> yep
[02:44:34] <r01010010> well it was into a call back and it didn't work for that
[02:44:41] <r01010010> now i took it out and works fine
[02:44:48] <r01010010> i don't know WHY
[02:45:48] <r01010010> wow super strange
[02:46:15] <r01010010> there's another object called connection for mysql and if i change that name it works!
[02:46:42] <r01010010> wow
[03:52:42] <r01010010> how can i insert in node.js with mongodb driver an object with the objectid already setted?
[03:56:47] <joannac> erm, just insert the object with the _id field?
[03:57:47] <r01010010> ok...
[04:16:42] <r01010010> so mongo.db doesnt work with big scripts or what?
[05:05:11] <GothAlice> …
[06:14:20] <BuildRPMPackage> Hello friends
[06:14:36] <BuildRPMPackage> I am trying to build mongo rpm using the packager.py script
[06:15:04] <BuildRPMPackage> My target is x86_64, redhat
[06:15:23] <BuildRPMPackage> I am building on CentOS
[06:16:41] <BuildRPMPackage> I modified the packager.py script slightly to only build for the said target I had
[06:17:13] <BuildRPMPackage> but I keep getting errors related to man page..
[06:17:44] <BuildRPMPackage> it says that the debian directory should be there to move the man pages. Does anyone know a workaround it?
[06:20:20] <BuildRPMPackage> here is teh exact error
[06:20:20] <BuildRPMPackage> in/mongotop' `BINARIES/usr/bin/mongooplog' -> `/tmp/tmpBf8Jzv/rpmbuild/BUILDROOT/mongodb-org-2.6.5-1.el6.x86_64/usr/bin/mongooplog' `BINARIES/usr/bin/mongofiles' -> `/tmp/tmpBf8Jzv/rpmbuild/BUILDROOT/mongodb-org-2.6.5-1.el6.x86_64/usr/bin/mongofiles' + mkdir -p /tmp/tmpBf8Jzv/rpmbuild/BUILDROOT/mongodb-org-2.6.5-1.el6.x86_64/usr/share/man/man1 + cp 'debian/*.1' /tmp/tmpBf8Jzv/rpmbuild/BUILDROOT/mongodb-org-2.6.5-1.el6.x86_64
[06:20:48] <BuildRPMPackage> + cp 'debian/*.1' /tmp/tmpBf8Jzv/rpmbuild/BUILDROOT/mongodb-org-2.6.5-1.el6.x86_64/usr/share/man/man1/ cp: cannot stat `debian/*.1': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.rBsE48 (%install) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.rBsE48 (%install) Traceback (most recent call last): File "./packager1.py", line 653, in <module> main(sys.argv) File "./packager1.py",
[06:21:11] <BuildRPMPackage> sorry for the non-formated paste
[06:21:28] <BuildRPMPackage> can someone help here?
[06:25:27] <BuildRPMPackage> is there anyone around here?
[07:33:11] <kenITR> very new to Mongo. When I do a find(), should mby docs have a lot of slashes in them?
[07:33:47] <kenITR> oops, "my docs"
[11:57:30] <lareth> Hello I want to create a new collection which will save the results of my mapreduce jobs. I know I can use "out" for that. What I want though is the results to be saved in a structues like collection.year.mongth.results. How can I do that?
[15:22:17] <dreambox> hey guys, I'm trying to do a within() geometry thingie...
[15:22:19] <dreambox> https://gist.github.com/cde1dc9be067e2555540
[15:22:31] <dreambox> I'm not a DB guy , total noob so please be gentle
[15:22:35] <dreambox> I get a bad request.
[15:28:37] <wsmoak> interesting… have you tried making it simpler? without the sort and populate perhaps?
[15:28:47] <wsmoak> just comparing it to https://github.com/aheckmann/mquery#geometry
[15:29:35] <dreambox> I will start simplifying it yes (this is all MeanJS boilerplate)
[15:31:10] <dreambox> removed sort and populate, unfortunately no change :(
[15:31:41] <dreambox> I am wondering whether it should be where('location') or where('message.location')
[15:31:53] <dreambox> basically how on earth do you debug something like this ? :(
[15:39:28] <dreambox> wsmoak: in the examples you gave me (very cool btw) , it doesn't show how the 'loc' should look like..
[15:39:35] <dreambox> maybe thats where the pbm is
[15:41:32] <wsmoak> so that appears to be the underlying mongodb operator: http://docs.mongodb.org/manual/reference/operator/query/geoWithin/#op._S_geoWithin
[15:42:17] <wsmoak> what I haven’t found is, what must the data you are querying look like ?
[15:43:16] <wsmoak> basically I want to insert some sample data and see that query work at the command line
[15:43:38] <wsmoak> can you paste some sample data in a gist ?
[15:46:40] <wsmoak> okay, it’s becoming clearer :) http://blog.mongolab.com/2014/08/a-primer-on-geospatial-data-and-mongodb/
[15:50:10] <dreambox> of course I can
[15:50:44] <sethetter> I'm trying to model a poll application, where each poll has choices and those choices have votes. A vote will be tied to a user. Is it more "mongo-ish" to embed choices and votes inside the Poll document? Or have each as it's own resource with assocations like I would with a relational DB?
[15:50:57] <dreambox> https://gist.github.com/9616a55dcb7be9768418
[15:51:06] <dreambox> wsmoak: https://gist.github.com/9616a55dcb7be9768418
[15:55:12] <dreambox> wsmoak: I am reading the article looks quite good - does it mean in my data I have to add a 'type' property ? (point)
[15:55:23] <dreambox> and the lat and long should be an array instead?
[15:57:42] <wsmoak> apparently that (type + coordinates) is GeoJSON format … what version of mongodb are you using?
[15:58:21] <dreambox> $ mongo help
[15:58:21] <dreambox> MongoDB shell version: 2.4.11
[15:59:46] <dreambox> how do I see my version actually!?
[15:59:52] <dreambox> I tried dpkg but it doesnt work
[15:59:54] <wsmoak> it probably matches the shell , but try “mongod —version”
[16:00:10] <dreambox> yep, 2.4.11
[16:00:51] <wsmoak> just checking because that last link mentioned some 2.4+ and 2.6+ features
[16:00:58] <dreambox> ye indeed
[16:01:19] <dreambox> did you manage to run a simple query with the data I pasted?
[16:01:23] <dreambox> & did it work?
[16:02:51] <wsmoak> haven’t. I’m not sure about that sub document you have vs the array I see in all the docs...
[16:04:17] <wsmoak> (for location)
[16:05:30] <dreambox> yes, same here
[16:05:53] <dreambox> damn and I have no idea how to change that as I'm irrelevant with expressjs
[16:06:27] <dreambox> wsmoak: any idea? https://gist.github.com/475177b3403ab83939d9
[16:09:44] <wsmoak> so many moving parts! Apparently you are using https://github.com/trenskow/isvalid-express.js
[16:10:12] <wsmoak> with https://github.com/trenskow/isvalid.js underneath
[16:10:25] <dreambox> :O
[16:10:28] <dreambox> I had no idea :)
[16:10:31] <dreambox> it's all MeanJS
[16:10:39] <dreambox> I can give u my git repo if u want
[16:10:58] <dreambox> https://github.com/gkatsanos/isawu (in 'app' the backend stuff)
[16:34:40] <dreambox> wsmoak: you abandonned? :)
[16:36:19] <wsmoak> this is fun! I’m adding locations to my example app to see if I can get to where you are.
[16:36:44] <wsmoak> so… on yours, who wrote the schema ?
[16:37:02] <wsmoak> I’m far from an expert, I don’t want to tell you to change it and make it worse :)
[16:49:37] <Zerg_Rush> hey whats the quickest way to check something like: select x from TABLE where (a=1 and b=1) or (a=2 and b=2) or (a=3 and b=3) .... thanks guys. I'd say $or : [{a:1, b:1}, {a:2, b:2}, ...] but I'm not totally sure if the mongo query equals to the mysql query. thanks for help
[16:51:37] <dreambox> wsmoak: it's a MeanJS boilerplate.. it's generated out of commands, I didn't write much. (ok, I added the location)
[17:01:57] <wsmoak> dreambox: to me it looks like you’ll need to use GeoJSON format for your location so that you can query it. I found this that might help with your schema http://stackoverflow.com/questions/15556624/how-does-one-reprsent-mongodb-geojson-fields-in-a-mongoose-schema
[17:02:42] <dreambox> thanks ! I will try that
[17:09:55] <wsmoak> dreambox: from the original query and your sample data … which of those items would you expect to fall within the polygon?
[17:10:23] <wsmoak> I have a query working but it’s always giving back null, not finding anything within the area
[17:28:59] <dreambox> wsmoak: ?
[17:29:22] <dreambox> I got disconnected.. I saw your last message.. I just put random coords in the polygon, I dont know if it would work
[17:35:50] <wsmoak> dreambox: yeah… I don’t think that’s a polygon. :) the ones on http://blog.mongolab.com/2014/08/a-primer-on-geospatial-data-and-mongodb/ have the same starting and ending point, making a closed figure.
[17:37:15] <wsmoak> I got mine to work like that example, with a 1-unit box starting and ending at 0,0, and a point at 0.5, 0.75 within it.
[18:22:11] <qutwala> hello everybody
[18:25:49] <dreambox> wsmoak: so I do need the array thingie and I also need the 'type' ? as in the documentation?
[18:27:21] <wsmoak> it looks like you could get away with the legacy 2d location … and that the embedded document is actually legal. http://docs.mongodb.org/manual/core/2d/
[18:27:59] <wsmoak> but if this is new development I would go with GeoJSON
[18:28:22] <wsmoak> (that is, you don’t have a ton of data already in the legacy format)
[18:29:18] <dreambox> no its totally new and experimental
[18:29:47] <wsmoak> and it seems like “how to validate GeoJSON” should be a solved problem, something you just include into your schema :/
[18:37:57] <wsmoak> dreambox: what are you using on top of mongodb? that .where().sort() syntax ?
[18:38:33] <dreambox> mongoose
[18:41:33] <dreambox> (I think?)
[18:43:22] <dreambox> yep, mongoose.
[18:49:23] <wsmoak> dreambox: so the current issue is changing your schema to accept the location in GeoJSON format?
[19:28:28] <dreambox> yep :) I looked at the stackoverflow question but..
[19:28:45] <dreambox> seems like there's an issue with mongoose and the schema when u re trying to make it
[20:39:48] <qutwala> http://dba.stackexchange.com/questions/83399/mongodb-insert-performance who can give any suggestions?
[21:38:29] <AlexZanf> hey guys, when i insert a new item into my collection, it creates an id that is an objectId, how can I make it so that its just an auto incrementing integer instead?
[21:39:57] <AlexZanf> this is only for testing, not production
[21:42:57] <Derick> there are no auto increment ids in MongoDB
[21:43:25] <joannac> assuming you have a single app (and single threaded), do it app-side?
[21:44:34] <AlexZanf> oh i see
[21:45:28] <wsmoak> AlexZanf: http://docs.mongodb.org/manual/tutorial/create-an-auto-incrementing-field/ looks promising…
[21:45:45] <AlexZanf> wsmoak, thanks