PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Tuesday the 25th of June, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[02:51:45] <groundup> What is the correct way to check for duplicate key error with the PHP lib?
[05:50:52] <groundup> I have a custom _id which is a string. If I am not using the MongoId object, am I going to break anything?
[06:05:57] <pwned> groundup: is your _id unique like ObjectId ?
[06:06:39] <groundup> yes
[06:06:49] <pwned> "Although it is common to assign ObjectId values to _id fields, if your objects have a natural unique identifier, consider using that for the value of _id to save space and to avoid an additional index." => http://docs.mongodb.org/manual/core/document/#record-documents
[06:06:50] <groundup> random 5 alphanum string
[06:07:31] <pwned> oh you want to generate your own
[06:07:52] <pwned> anyway it is a good read
[06:07:57] <groundup> Yeah, although the Mongo _id is nice and easy and I use it when I don't have to display the id, I want to display it
[06:08:13] <groundup> 24 characters in a uri is not very user-friendly heh
[06:08:49] <pwned> you could display it in terms of getTimeStamp()
[06:08:53] <groundup> Granted, I have a slug which is another field. I am thinking about combining them
[06:09:24] <pwned> mongo ObjectIds store creation time
[06:12:35] <pwned> I would combine slug with creation time
[06:13:05] <groundup> Meh, creation time is almost never used
[06:13:18] <pwned> looks nice in a url
[06:13:32] <groundup> In fact, I am probably not even going to put an index on it. I am probably just going to use a collection to store the most recent objects
[06:13:52] <groundup> These aren't blog posts. They are places. So, when they were created is almost irrelevant
[06:14:01] <pwned> haha
[06:14:15] <pwned> yes it is
[06:52:02] <sinclair|net> pwned: are you super awesome?
[07:33:10] <pwned> sinclair|net: as far as I know, yes!
[07:35:07] <[AD]Turbo> yo all
[07:37:45] <Nodex> lol
[07:42:37] <jackh> Hi, all, anyone knows how to port mongodb to non-x86 machines?
[07:45:15] <paulkon> like what machine
[07:45:29] <paulkon> port to what
[07:49:39] <jackh> paulkon: to powerpc
[07:50:17] <jackh> paulkon: since we need to deploy it on IBM power box
[08:26:13] <lessless> hi folks! if logic of an application involves creating of document with flexible structure: user can create certain amount (>10) of arbitrary fields is mongodb a right thing to choose?
[08:46:00] <paulkon> lessless: sure
[08:51:36] <lessless> paulkon, what is a god book to kick off with mongodb?
[08:55:37] <mac_nibblet> Can mongodb + map reduce be used to select documents that exist in two given collections ?
[08:57:49] <ConneXNL> Is there any hybrid way to Embed some fields + make a reference? For example, a comment author would be the embedded field "LastName" and "E-mail" of a User Document?
[08:58:57] <Nodex> you really should avoid relations where possible
[09:05:14] <jackh> seems no one ever tried to port mongo-db to arm, powerpc...
[09:21:06] <tairov> Hi all!
[09:22:22] <tairov> Does anybody tried to move mongodb database to a new server by creating a slave replica and after syncing switching it as a master?
[09:23:29] <tairov> I want to move ~400GB database to a new server. And think about how to do it without shutting down the service.
[10:44:21] <aszeszo> hi all, is anyone aware of any solaris/smartos related improvements to mongodb?
[10:45:12] <aszeszo> i am mainly interested if memory allocation issue has been resolved yet http://bit.ly/1aJYQOr
[10:46:01] <aszeszo> is there a way to tell mongodb what's the maximum amount of memory it is allowed to use?
[11:16:39] <Nodex> aszeszo : mongodb will use as much memory as it can, iirc there is a config option to limit it somewhere but I could be imagining it
[11:19:57] <aszeszo> Nodex: config option would be a good workaround
[11:21:22] <aszeszo> the way how mongodb is using memory by default is not very compatible with how smartos is enforcing zone memory limits (zones are like linux containers or freebsd jails - they share the same kernel with the host)
[12:18:03] <statu> Hi! It is my first time using a non relational BD and I am very lost with the design
[12:18:33] <statu> I was searching in the mongodb website but I haven't found any resources about designing
[12:19:20] <statu> Any suggestion?
[12:19:59] <Nodex> what are you trying to accomplish?
[12:22:02] <statu> I want to do a little social network
[12:22:27] <Nodex> and you're sure a non relational DB is the right choice?
[12:25:05] <statu> Nodex, nope. But I'm sure that the relational DB isn't
[12:25:42] <statu> I saw several examples of mongo db documents and I found it interesting for my purposal
[12:26:52] <statu> Do you think so?
[12:27:56] <Nodex> I don't know what your social network will look or operate like so I cannot comment
[12:28:26] <Nodex> I don't know what level of functionality you require etc etc
[12:31:40] <statu> Nodex, think in Whatsapp. You have friends and you can chat them
[12:32:08] <Nodex> I don't know what "Whatsapp" is sorry
[12:35:01] <statu> Nodex, sorry! doesn't matter
[12:38:03] <Nodex> are you asking how to arrange your data?
[12:57:46] <eddd> can i use project in aggregation(pymongo) somehow like this {'$project' : {'date': 'new Date(year, month, day)'}} year, month and day comes from aggregation
[12:58:02] <eddd> i mean, from groupby _id dict.
[14:04:07] <CD_> can I use MongoDB on MS Azure Platform?
[14:28:10] <michael____> hey is following possible: I have embeded documents B in documents A of collection 1 and documents C in collection 2, documents C are referencing the embeded documents E of collection A ?
[14:29:13] <astro73|roam> michael____: you could conceivably declare such a structure
[14:29:28] <astro73|roam> i'm not away of any driver that will automatically do that for you
[14:31:41] <Nodex> avoid that sort of referencing tbh
[14:32:11] <michael____> astro73|roam: thank you, would it make sense to store the id of document A as well? I thought because of deep querys in mongo db it is not necessary
[14:32:42] <astro73|roam> it depends on your unique identifiers
[14:33:13] <astro73|roam> just because it's non-relational doesn't mean you get to forget everything you learned about databases
[14:34:20] <michael____> Nodex: why? the amount of documents is to big to store and would end up in not being flexible I guess
[14:34:50] <michael____> astro73|roam: :-) in terms of the id? yeah you are right
[14:34:54] <Nodex> are you asking me or telling me?
[14:36:20] <michael____> Nodex: mh messing a document too much up is not the right way I discovered
[14:44:59] <generic_nick> anyone use pymongo?
[14:47:13] <klj613> hello - i'm on a intel i5 8GB memory desktop (development) with mongodb.. however i'm getting about 1 write per second. i assume that isn't normal? (the collection got about 5 fields + the default _id_ index)
[15:48:01] <ClearsTheScreen> hi :) sorry for barging in with a question on my lips, but my google-fu is weak -- i have a user with "readWriteAnyDatabase". however, when i `mongo -p -u <user> localhost/some_database` and enter the password, the mongo shell rejects me. unless i `use some_database` and `db.addUser(...)` the same user to the database as well. what am i doing wrong? do i miss something obvious?
[16:52:20] <chewed-on> Hello all.
[16:52:29] <chewed-on> I just downloaded MongoDB on my Mac
[16:52:39] <chewed-on> how do I install it so that I can run it from shell ?
[16:52:57] <chewed-on> http://docs.mongodb.org/manual/tutorial/install-mongodb-on-os-x/
[16:53:01] <mediocretes> just unzip it somewhere, there's no real install process
[16:53:04] <chewed-on> I'm on that page but I'm a bit confused..
[16:53:18] <mediocretes> or use brew
[16:54:07] <chewed-on> mediocretes: what about the mongo script thing ?
[16:54:10] <chewed-on> what is that ?
[16:54:13] <Nodex> sell your mac and buy a decent computer = problem solved
[16:54:15] <chewed-on> mongod --config /etc/mongod.conf
[16:55:18] <chewed-on> mediocretes: from MySQL experience, I recall I need to setup a username and password for my database etc but this page doesn't describe that process
[16:55:38] <mediocretes> by default, mongod doesn't run with auth
[16:55:52] <mediocretes> you don't really need a config file, the defaults are mostly fine for development
[16:56:46] <chewed-on> Wed Jun 26 00:55:57.817 JavaScript execution failed: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112 exception: connect failed
[16:57:34] <chewed-on> that's what I get when I run: ./bin/mongo
[16:57:43] <mediocretes> is mongod running?
[16:58:00] <chewed-on> no…I haven't done anything
[16:58:13] <chewed-on> cool
[16:58:35] <chewed-on> alright thanks
[16:58:37] <chewed-on> I got the shell now
[16:58:49] <mediocretes> you'll be webscale in no time
[16:58:56] <chewed-on> ?
[16:59:02] <chewed-on> some pun ?
[16:59:28] <jsuggs> http://mongodb-is-web-scale.com/
[17:00:26] <chewed-on> mediocretes: right some last few questions, If I were to run a Geddy Node.js web app, and want to write some data to it, then I have to keep my mongod running ?
[17:01:22] <chewed-on> or is the mongod (daemon?) only turned on so I can get shell access ?
[17:01:32] <mediocretes> yes, it must be running
[17:02:11] <chewed-on> So in a real deployed server, would I have to use something like Forever daemon tool to keep MongoDB running ?
[17:03:05] <mediocretes> there are config options to make it run in the background
[17:06:40] <chewed-on> mediocretes: thanks for help
[17:07:02] <sharondio> Hi all…would an upsert work if just updating an array item that doesn't exist, even if the collection item exists? Or would it try to create a new item?
[17:07:13] <bcave> hello
[17:07:47] <mediocretes> also if you're getting started with node, take a look at https://modulus.io/, they know what they're doing.
[17:08:29] <bcave> is there a given process for restoring from raw data files? specifically, for restoring from data files into an existing replica set....
[17:09:20] <chewed-on> mediocretes: rigtio, thanks
[17:09:23] <chewed-on> rightio
[17:09:26] <mediocretes> bcave: http://docs.mongodb.org/manual/tutorial/resync-replica-set-member/#resync-by-copying-all-datafiles-from-another-member
[17:11:02] <bcave> thanks mediocretes.
[17:11:25] <bcave> but if I have an initialized RS with no data in it, and want to restore a whole lot of databases ... ?
[17:12:20] <mediocretes> you'd probably need to restore your data to a new server and build an RS around it
[17:12:49] <bcave> yeah, start up a single node with all the datafiles already restored and then deploy the RS
[17:13:42] <bcave> that's what I figured. or use a standalone instance with the data files -> mongodump -h standalone -> mongorestore -h rs_primary
[17:15:18] <bcave> not very flexible though... would be great if MMS backup service gave mongodump files.
[17:15:34] <mediocretes> that would be expensive.
[17:22:59] <bcave> true
[18:14:19] <stefan41> what kind of performance implications does an incremental map_reduce have?
[18:15:14] <stefan41> i.e. if i am say, keeping averages of a group of things with a map-reduce, will it kill my db if i re-run my map-reduce every time an item is added? (for the sake of argument)
[18:20:20] <stefan41> or, maybe, more to the point, is an incremental map-reduce operation more performant than an aggregation across an entire collection?
[18:32:48] <dberry> I have a sharded configuration running 1.8.3, can I upgrade to 2.2 by doing a drop in replacement?
[20:23:59] <phillr> Anyone here work w/ pymongo? I get "bson.errors.InvalidDocument" when updating with a key using dot notation: 'value.subscriptions'
[20:24:11] <phillr> How does one properly do this with pymongo?
[20:33:31] <harenson> phillr: make a pastebin please, with your document structure and the query you're trying to get the result
[20:34:19] <phillr> harenson: thx, I think I've found it. The doc being updated wasn't using $set, so it overwrite.
[20:34:40] <harenson> phillr: xD
[20:39:18] <SrPx> Hello! Can I use MongoDB geospatial views as a way to check for collisions and objects inside a specific area, in a real-time application?
[21:08:26] <serapath> hi
[21:09:14] <serapath> after trying different things on my current project i found a simple tutorial https://github.com/mmukhin/psitsmike_mongodb_tutorial which works fine, but adds nothing to my database
[21:09:28] <serapath> i added mongoose.set('debug', true);
[21:09:52] <serapath> and it logs "Mongoose: people.find({}) { fields: undefined, safe: undefined }" to the console
[21:09:59] <serapath> any ideas?