PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Thursday the 15th of May, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:48:20] <GeraldDev> hello. In order to have a psuedo-auto incrementing ID, I created a field called "my_id" for each record in my collection. It just converts the last 3 bytes of the default ObjectID to an int. I am using the PHP mongo driver. The problem is..if I wait a few hours, it seems the global counter drops back to 40. Anyone know why this might be the case?
[03:15:03] <edrocks> how do you use $centerSphere on geojson objects? do you just pass in the coordinates part or would that end up using the legacy coordinate pairs?
[04:11:47] <SethT> anybody have experience using mongo mapreduce on large datasets to dedupe
[07:06:25] <nukeu666> how do i cancel a command when its stuck in ... ?
[07:25:36] <kali> nukeu666: press return three times
[07:26:16] <nukeu666> cool thanks
[09:58:49] <Industrial> Hi.
[09:58:51] <Industrial> http://docs.mongodb.org/manual/reference/command/aggregate/#dbcmd.aggregate
[09:59:14] <Industrial> I'm trying to find what the cursor option actually does but
[09:59:17] <Industrial> "Optional. Specify a document that contains options that control the creation of the cursor object."
[10:01:03] <Industrial> basically I'm just wonderinf if I need to configure anything at all there.
[10:56:34] <kali> Industrial: it basically depends how big is the result you're expecting
[10:57:02] <kali> Industrial: if it's significantly smaller than 16MB, no need to bother with the cursor
[12:13:48] <CJ_> Is this correct? Range operations for paging will only work if I have an indexed field that is sorted in the way that I want to query?
[13:43:14] <Mikee> Hi - I'm having an exception thrown with the PHP drivers about an overflow. is this the right place to ask about php drivers?
[13:43:18] <Mikee> " MongoCursorException: localhost:27017: Runner error: Overflow sort stage buffered data usage of 33556006 bytes exceeds internal limit of 33554432 bytes"
[13:43:26] <Mikee> I'm not too sure how to solve it, and google isn't being much help
[13:43:53] <Derick> Mikee: that means that the sort job on the server needed more memory than was available for it
[13:44:03] <Derick> it's a server message, not a driver message
[13:44:38] <Mikee> I'm just sorting by a timestamp - and this collection isn't too big yet. What can I do to avoid this happening?
[13:44:50] <Mikee> (there's only about 4500 documents in the table)
[13:44:54] <Derick> make sure you use an index for sorting
[13:45:00] <Mikee> yeah it's indexed
[13:45:21] <Derick> it's not using the index
[13:45:27] <Derick> what does "explain" say, and what is your query?
[13:45:30] <Mikee> Ah. ok i'll look into it
[13:45:50] <Mikee> wow, sorry. you were right. How silly >.>
[13:46:03] <Mikee> Looked at those indexes 10 times and still apparently didnt notice ;)
[13:46:03] <Mikee> thank you.
[14:37:55] <pmercado> Hi
[14:40:37] <pmercado> Just learning mongodb :)
[14:40:46] <pmercado> I have some newbie questions
[14:42:18] <pmercado> like: how is the correct way to insert an image inside a document?
[14:43:09] <pmercado> db.mycollection.insert( {name: 'john', face: '___all image binary data here_____' } )
[14:43:19] <Derick> no
[14:43:27] <Derick> you need to wrap it in "BinData"
[14:45:32] <pmercado> "BinData" is.............
[14:46:04] <Derick> http://docs.mongodb.org/manual/reference/mongodb-extended-json/#binary
[14:53:38] <pmercado> ooohh ok
[14:54:20] <pmercado> so , there is two databases, one for data and one for files (gridfs), gridfs use two collections: one for data and another for metadata
[14:55:55] <Derick> gridfs is not always necessary, only if you use files > 15.9MB or so
[14:56:52] <pmercado> the only way to asociate an image to a document is doing a reference to gridfs? I mean.... there is no vice-versa reference, because gridfs is only "a container"
[14:56:56] <pmercado> is correct ?
[14:58:13] <pmercado> vice-versa relation thought as rdb
[14:58:17] <Derick> well, I suppose you can store your document in the meta data
[14:59:53] <pmercado> and if file is about 19MB, is inserted anyway using Gridfs or engine throw an error and will not insert file?
[15:08:30] <pmercado> from http://docs.mongodb.org/manual/reference/mongodb-extended-json/#binary :
[15:08:52] <pmercado> "<t> is the hexadecimal representation of a single byte that indicates the data type." <--- where can I find reference of "single byte that indicates data type"?
[15:09:36] <Derick> http://bsonspec.org/spec.html (search for "subtype")
[15:11:58] <Derick> in general, you want 0
[15:19:20] <pmercado> is this object correctly inserted? :
[15:19:21] <pmercado> { "_id" : ObjectId("5374d81b34a09b396a891a01"), "a" : "hola", "b" : BinData(0,"/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAUAAA/+4ADkFkb2JlAGTAAAAAAf/b") }
[15:19:54] <pmercado> object got from db.collection.find();
[15:29:27] <_automan> I need a little help with replication and sharding concepts. :)
[16:09:12] <q85> http://docs.mongodb.org/manual/reference/limits/#Sharding-Existing-Collection-Data-Size
[16:09:56] <q85> The docs stated you may be able to shard a collection upto 400 GB is size depending on the distribution of doc sizes.
[16:10:24] <q85> If the doc sizes are all the same, can a person expect to be able to shard a 400GB collection?
[16:11:53] <q85> Does anyone have good resource references on the subject?
[16:45:30] <pmercado> argh
[16:45:43] <pmercado> can't find how to add binary data inside a document
[16:45:49] <pmercado> in java
[16:46:08] <pmercado> Javascript is using BinData, but in Java world ?
[16:46:30] <pmercado> there is a special class or something in jdk or mongodb driver ?
[16:49:57] <pmercado> argh!, finally!:
[16:49:59] <pmercado> An array of bytes (byte[]) as a value will automatically be wrapped as a Binary type. Additionally the Binary class can be used to represent binary objects, which allows to pick a custom type byte.
[16:50:09] <pmercado> in java driver doc, easy!, but hard to find
[17:11:42] <Fender> hi there, I am in mongoshell and I need to add one document ("b") to the collection that is exactly another document ("a") in the same collection but with one value changed. Can I do this from mongoshell rightaway?
[17:12:59] <Fender> something like db.getCollection("C").find({"symbol":"a"})... <and then somehow change "a" to "b" and insert it>
[17:13:34] <Fender> I know there is only one doc with symbol "a", just in case
[17:21:41] <Fender> OK, Ill try this one
[17:21:41] <Fender> http://blog.safaribooksonline.com/2012/12/19/programming-with-mongodb/
[17:23:08] <Fender> ...and I'll use findOne
[17:25:12] <Fender> it's so easy, you just have to find the right post. Thanks for ehm your presence :)
[18:19:01] <omus> Can anyone help me with a mongoexport problem I'm having?
[18:21:16] <jiffe98> I just had a disk error and now that replica is showing '"errmsg" : "syncThread: 10334 BSONObj size: -1717986919 (0x99999999) is invalid. Size must be between 0 and 16793600(16MB) First element: ...' in rs.status()
[18:21:32] <jiffe98> any way to skip whatever entry is causing this problem?
[18:23:23] <pmercado> what's mongodb ? :P
[18:23:28] <pmercado> newbie questions here :(
[18:39:46] <whaley> pmercado: see first link in the /topic
[19:43:03] <pmercado> in Java: what advantage can I take if I implement DBObject interface to my own POJO?
[19:43:38] <pmercado> I mean... I have to implement some abstracts methods , but in a bussines logic should be a good practice ?
[20:34:58] <jblack> Does anyone here work on the mongodb chef cookbook?
[20:36:12] <jblack> The way that the attributes file handles platform doesn't work right when using a berkshelf style setup
[21:43:34] <Guest78521> Hi all. Is it possible to change the insertion order or natural order ?
[21:55:44] <Guest78521> Someone ??
[21:57:59] <ranman> Guest78521: what do you mean by that? to sort on something else?
[21:58:26] <ranman> Guest78521: you can reinsert the documents in a different order or sort on something else, as far as I'm aware that's your only choice.
[21:59:18] <Guest78521> I would like to get my data on the descendant order of insertion
[21:59:34] <Guest78521> Now the default is ascendant
[22:00:10] <Guest78521> without specifying a sort option in my query
[22:04:26] <ranman> Guest78521: http://docs.mongodb.org/manual/reference/operator/meta/natural/ ?
[22:05:21] <Guest78521> Is it possible to set it by default ?
[22:11:17] <ranman> Guest78521: I don't know what you mean by that but probably not
[22:11:28] <ranman> Guest78521: just within the shell?
[22:12:04] <Guest78521> Meaning everytime I do a query, even if I don't specify a sort() it will return the result sorted by natural -1
[22:14:38] <Guest78521> I'm using a capped collections
[23:29:24] <daidoji> Guest70926: was it sorted when you inserted it?
[23:29:52] <daidoji> also, anyone here have experience with bulk inserts and have thoughts on best workflow for dealing with them?
[23:31:04] <daidoji> basically, I'm using a field as a key that gets updated every once in a while so my bulk insert operation will throw a DuplicateKeyError
[23:31:23] <daidoji> but what I'd like to do is get all those exceptions and save those records in another file in my script for review later
[23:31:50] <daidoji> but the pymongo documentation and mongo docs look like it'll only return one of my errors and not all the errors for a given bulk insert