[06:36:13] <meadhikari> joannac, i was given a schema with dbref in it, i need to make an API with CRUD from http requests, how do i handle dbref when i send data through json? Am I thinking this wrong? please help
[06:39:21] <joannac> I don't understand the question, meadhikari
[06:39:40] <joannac> what do you mean by "how do I handle DBref?"
[06:39:59] <joannac> how do you process it? How do you save it in mongodb? what exactly are you asking?
[06:40:31] <meadhikari> send it as json in post request and save it in mongodb
[06:41:30] <joannac> you want to know how to turn a DBref into valid JSON?
[06:42:08] <meadhikari> i have the schema like https://gist.github.com/meadhikari/34b788bfd0c48aa2b3b8
[06:42:25] <meadhikari> i want to do crud in this collection through http requests
[06:43:05] <meadhikari> if there was no dbref, i would do it pretty easily but now i am confused how to handle it, make it valid json
[06:43:30] <joannac> That's all explained in the page i linked
[06:44:04] <joannac> specifically, you create objects, assign them, and mongoose takes case of the details
[06:48:31] <meadhikari> joannac, in json i create key as "_key" and attribute as the id of the object i am referring to?
[06:52:01] <joannac> meadhikari: if you want to make your own Dbref, look here: http://docs.mongodb.org/manual/reference/database-references/#dbrefs
[06:52:25] <joannac> If you want to make you own manual reference, do whatever you like
[07:15:06] <meadhikari> joannac, thanks for your time. I got it working
[08:11:19] <meadhikari> Hi guys, I am using mongoose keep getting "Error: Cannot use a writeConcern without a provided callback" my code is https://gist.github.com/meadhikari/97b436d0cd32700d2c09 please help
[08:12:58] <cheeser> i'm not a big js guy but it looks like you don't define callback until after you've "passed" it to update()
[08:16:40] <meadhikari> cheeser, this gives same response https://gist.github.com/meadhikari/97b436d0cd32700d2c09
[09:54:15] <KamZou> Hi, i've an issue with an index on a secondary RSM : http://pastebin.com/eAwgiWAt So i tried : http://docs.mongodb.org/master/tutorial/build-indexes-on-replica-sets/ But when i'm trying to create an index on the collection and field i was warned about, mongo tells me index is already existing on field _id Any idea please ?
[09:56:58] <rspijker> KamZou: you already have an index on _id, but it’s not unique?
[09:57:43] <KamZou> rspijker, hmmmm so the issue is that it's not unique ? How could i ensure that ?
[11:50:11] <AlexejK> Spammers now reaching mongoDB JIRA as well? https://jira.mongodb.org/browse/JAVA-710?focusedCommentId=673390&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-673390 or is it just me not understanding a single word of the comment? :P
[11:54:20] <kali> AlexejK: I think you're right :)
[12:26:06] <zack___> If I have one class but it is called differently by two methods and I wanted to store that class in Mongo
[12:26:23] <zack___> How would I differentiate how it was used by having two different collections based on that one class in mongo?
[12:27:06] <kali> zack___: well, it depends what you're using to tranform these java classes in mongodb docuents
[12:28:08] <zack___> In my dao I just have two different repos that extend MongoRepository<MyClass, String> and I have that in both repos
[12:28:25] <zack___> I want to avoid making that same class again and just naming it differently
[12:28:50] <zack___> Is there a way to specify the collection name without it being based on the classname?
[12:30:26] <kali> zack___: you're using spring's MongoRepository ?
[12:30:39] <zack___> Yes, sorry if that wasn't specified
[12:31:42] <kali> i can't help more, but maybe somebody with spring knowledge will jump in
[12:31:58] <zack___> I heard something about a @Document annotation.
[12:32:26] <zack___> I'm just wondering if it's possible to use one class and make two collections out of it that are named differently. Right now it just takes the class name and names the collection after that
[13:37:35] <bin> why using db.copyDatabase the copied database is with smaller size?
[13:48:32] <kali> bin: because it is defragmented along the way: see this http://docs.mongodb.org/manual/faq/storage/
[13:49:00] <bin> ahhhh i see so all of the free space is defragmented right ?
[13:49:07] <bin> and all documents are next to each other
[17:20:33] <jParkton> Nodex: I am connected to my db, and my collection but how do I render that to my page? Iknow that newb but, I have this https://gist.github.com/jparkton/79257113079072ff2172
[17:21:03] <jParkton> when I go to my /users page all I see is 'users' and not my collection, I am doing it wrong clearly but how do I correct it?
[17:27:39] <mrcni> items in my collection have two ids.. one is " "id": null," and the others look more like "_id": ObjectID("53d3130d97bd3b8c249d527e"),
[17:29:17] <mrcni> a) i don't know why this is happening. b) it's causing problems for my policies to grab the userid for authentication, users have full access to admin controls. can someone hwlp
[17:29:54] <mrcni> i'm working with sails@beta which works with node and express on windows 7 pc
[17:39:08] <Nodex> jParkton : that's down to your app
[17:41:18] <Nodex> mrcni : the _id is mongo's internal objectId
[17:41:41] <Nodex> similar to an auto increment pkey in a relational table - this is a unique identifier
[18:02:07] <mrcni> would you be able to suggest why it's making this null Id field ?
[18:02:48] <mrcni> aside from that, i still can't grab the user id for comparison
[18:03:45] <kali> mrcni: show us your best attempt
[18:07:22] <mrcni> i tried console.log(User.id) and console.log(User._id) -- console returns undefined. i think it's not returning because the User.id has not been created yet. i've set these console.logs in a 'beforeCreate' action that occurs before the user is created. but then i also tried it outside of this action and it was still undefined. all of this code is in the user model.
[18:11:43] <kali> i assume this is mongoose (or any other node.js contraption). you should paste the full example somewhere so somebody with knowledge in node.js can help
[18:13:09] <mrcni> i downloaded mongodb, the framework uses waterline orm
[18:14:20] <mrcni> i'm trying to console.log the information here https://github.com/mrcn/C_Express/blob/master/api/models/User.js
[18:14:49] <mrcni> it begins on line 60, inside the beforeCreate action.
[18:15:36] <mrcni> this doesn't show all my attempts to call for the user id.
[18:23:44] <Nodex> your app is creating the id field, the only thing MOngodb will auto create is an _id
[18:32:08] <jbernier> hi I’m using Pymongo as a client. Can anyone explain how to search for and remove orhpaned DbRef records ?
[18:32:48] <jbernier> my collection searches simply return the objects they reference - not the references themselves
[20:49:40] <mp_> i've collected event data similar to mixpanel/google analytics in a mongodb instance & am curious about best practices for using that data in a parallel SQL DB with a django application. For example, say I want to sort a table in postgres by an aggregation from a mongodb collection. If I can, I'd like to make clean-looking queries using the Django ORM with as clean of an interface to MongoDB as possible. Any thoughts about approachin
[21:00:03] <kali> mp_: first, use a smarter irc client. either that, or make shorter lines
[21:29:44] <MacWinner> when running a replicaset with 2 nodes, do you need to have some sort of 3rd node up to help prevent split brain situations?
[21:43:22] <ranman> MacWinner: typically a replicaset has 3 nodes
[21:43:41] <ranman> MacWinner: you'll need to run with at least 2 and 1 arbiter for master election purposes
[21:43:56] <ranman> the docs here have lots of awesome pictures that explain it better than I could: http://docs.mongodb.org/manual/core/replication-introduction/
[21:53:07] <MacWinner> ranman, thanks! almost done setting it up
[23:23:09] <Asterfield> Is there no way to get 3 random records from a collection?
[23:24:51] <AlexZanf> hey guys I have a user model, and i am trying to add profile images to users. Should i just add a images[int,int] list to the user model? with the first param being the image slot, and the 2nd param being the image name or id? or should i make a new image model and compose with it?
[23:25:17] <Asterfield> Why not an array of filepaths?
[23:46:04] <AlexZanf> Asterfield, what do you mean?
[23:48:20] <Asterfield> AlexZanf: Add an array to the user model. http://pastebin.com/UkEiWbYv
[23:49:29] <AlexZanf> Aster, thats basically what i have, eexcept i have a slot number too, but i guess that could just be the index
[23:50:10] <AlexZanf> and i will use ints instead of strings