PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Sunday the 22nd of March, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:37:17] <UltrA1> hello
[04:37:20] <UltrA1> I have freebsd 10.1-RELEASE-p4 upgraded to 10.1-RELEASE-p6 the issue it's causing is with mongodb wont start
[04:37:28] <UltrA1> any ideas?
[04:39:33] <UltrA1> going from 10.1-RELEASE-p4 ..to..10.1-RELEASE-p6 caused mongodb to no longer start.. my friend called me so im asking you.. thanks
[05:51:43] <UltrA1> he reverted back works fine
[05:51:48] <UltrA1> later
[15:51:41] <Gottox> hi! a quick question: is mongodb following the odd=unstable/even=stable version scheme?
[19:33:16] <nukeu666> I need all field1's for unique field2's, i can get unique field2 by aggregate {$group:{_id:{field2}},.?.}
[19:33:46] <nukeu666> What can I add after the group to give me a list of all field1's that a field2 has?
[20:03:01] <aliasc> Hi all,
[20:03:40] <aliasc> whats the best way to model categories and subcategories for a blog in mongodb
[20:03:49] <aliasc> relational or embedded
[20:29:04] <altamish> Hi all, I am uploading an image on GridFS by fs.put(request.files['productImage']) , but when i try to download it using fs.get(_id) it returns bytes, how can i convert it to image or better yet get an image file?
[20:30:10] <altamish> GothAlice please help
[20:31:06] <GothAlice> altamish: GridFS knows not what the type of the data is, in general. If you know it's image data, you can funnel it into Pillow (an image library) to process it, or serve it straight back from the web app.
[20:31:36] <GothAlice> How you do this last part depends on the framework. In most you need to set a mime type on the response and return the bytes, or set the "body" of the response to bytes.
[20:31:56] <GothAlice> s/to bytes/to the bytes/
[20:32:34] <altamish> i am using flask and pymongo
[20:32:54] <altamish> you mean i should pass content-type=image/jpeg?
[20:33:09] <GothAlice> I have no idea.
[20:33:50] <GothAlice> When accepting file uploads I make sure to also store the incoming file name and incoming mime type, and store them along with the reference to the GridFS file. Then, when serving the data back, my web has everything it needs and the code looks like:
[20:35:19] <GothAlice> response.content_type = document.content_type; return document.read()
[20:37:31] <altamish> thanks, i think i will try to set mime type while uploading
[20:37:53] <GothAlice> You can do so in the put: fs.put(someFileArgument.file, content_type=someFileArgument.mime_type)
[20:38:13] <GothAlice> (Remember to also do it in any .replace() calls, if applicable.)
[20:42:45] <altamish> fs.put(request.files['productImage'], content_type = image/jpeg) , is this ok? request.files['productImage'] is file from html form
[21:16:57] <altamish> GothAlice I used PIL to open the pictures, img = Image.open(im), im has bytes.. and it works.. thanks for the tip
[21:17:04] <altamish> picture*
[21:17:28] <GothAlice> No worries. Also remember to quote the mime type string…
[21:18:20] <altamish> yep i did already... however i am trying to pass img.show() into <img src> and it doesnt seem to work.. do you happen any way to do this
[21:18:33] <GothAlice> -_-;
[21:18:40] <GothAlice> You still need to serve the bytes from your application.
[21:18:48] <GothAlice> img.show() would open up a GUI viewer program…
[21:19:17] <GothAlice> The src="" for your image would be the URL that serves that byte data.
[21:21:24] <altamish> you mean i should save it and then pass the local url to src
[21:21:31] <GothAlice> No.
[21:21:45] <GothAlice> Though that would be one approach.
[21:21:50] <GothAlice> (It's the more complex.)
[21:24:01] <altamish> okay...
[21:45:17] <altamish> this isnt working as well.. <img src="{{ im }}">
[21:46:10] <altamish> GothAlice I am sorry to ask you trivial question.. but could you please elaborate on the method you suggested
[22:23:22] <aliasc> how fast is mongodb compared to mysql
[22:30:22] <GothAlice> aliasc: I rarely get a chance to say this, but that's a bad question. ;) Fast in doing what?
[22:31:25] <GothAlice> (Not to mention the multitude of things MongoDB can do that MySQL flatly can't cope with.)
[22:31:37] <GothAlice> (And vice-versa. Relational, transactions, and whatnot.)
[22:37:59] <Streemo> How would I query a collection to find all documents which only contain one and only one field
[22:38:26] <Streemo> e.g. I want {_id: "asdadsadad" } but not {_id: "asdadsad", age: 124213424}
[22:51:22] <aliasc> @GothAlice i mean in general, development processing etc
[22:52:07] <aliasc> so far mongodb only allowed me for faster development, i cant really see its potential in processing
[22:54:11] <GothAlice> aliasc: http://s.webcore.io/image/142o1W3U2y0x generates in < 100ms after executing some pretty intense queries, querying ~17K documents.
[22:54:15] <GothAlice> So, uh, works for me? ;)
[23:02:03] <aliasc> i love mongodb for its scalability and simplicity. i come from the rdbms world. i just hope i won't be betrayed :D
[23:03:16] <aliasc> whats the tool you are using @GothAlice
[23:03:34] <GothAlice> aliasc: Tool? None, in particular. MongoEngine is the database layer I use.
[23:04:08] <aliasc> Well something visual to see your collections and documents
[23:04:13] <aliasc> currently i use Robomongo
[23:07:28] <GothAlice> Due to my reliance on triggers and field renaming in MongoEngine, I use the ipython shell to interface with my data.
[23:17:12] <Streemo> does anyone know how to query for documents that only have an ID field?
[23:31:23] <aliasc> wierd, every document has an id field
[23:31:30] <aliasc> if you mean _id specifically
[23:32:23] <aliasc> use $exists if you wish to test if a field exists