[01:35:05] <xdotcommer> ensureIndex( { 'products.id':1 }, { unique:true } ); .. does not seem to work with upsert and $push of a product
[02:53:24] <xdotcommer> Trying to do "Unique Restraint on subdocument" but its not working with upsert... ie update( { _id:3, products:[ { id:'123213' } ] } );
[02:53:40] <xdotcommer> does not work with $set modifier
[02:54:19] <xdotcommer> and $addToSet is supposed to work with documents only
[02:56:15] <xdotcommer> I also added uniue index like so ensureIndex( { 'products.id':1 }, { unique:true } );
[02:57:13] <xdotcommer> maybe I am using a wrong operator... I am assuming $push should do it
[02:58:18] <xdotcommer> Basically trying to replicate the suggestion in this Jira https://jira.mongodb.org/browse/SERVER-1176
[03:07:22] <xdotcommer> trying this https://groups.google.com/forum/#!msg/mongodb-user/uaiPPLcjJjY/QpNy54kdokkJ
[04:03:39] <AlexZan> hey guys, with mongoose, what is the difference between creating a schema with: var schema = new mongoose.Schema() vs. var schema = mongoose.Schema() ?
[08:23:00] <kali> AlexZan: it is common. i can't help with node.js stuff, but from what we heard here, mongoose is a safe choice in that weird universe
[08:26:31] <styles> How do you find a regex match that DOES NOT contain a string?
[11:16:24] <Lenny[]> I'm wondering if its possible when sorting documents by field, to decide if documents that dont have that field should be first or last, without influencing the sort order of the documents that has the field with ascending/descending ? In SQL i would just use two queries union to this into the same result set.
[16:55:51] <patrickn> Hello, new mongodb user. A friend sent a database with several .json and .bson files for an application. What's the best way to go about importing these into a database (up and running on debian)?
[16:57:05] <patrickn> I also have robomongo running on mac connected to server where I want to import
[17:06:16] <kali> patrickn: mongorestore. from your mac or the debian
[17:13:21] <patrickn> kali: great thanks, and that will import bson too?
[17:16:59] <kali> patrickn: well, i assume you were given a full database dump. it's a hierarchy of files (the root is likely called "dump") with database as directories, then one bson file for the collection data, one json file for the collection index definition
[17:17:34] <kali> patrickn: if that is the case, just use mongorestore at the top level
[17:18:10] <kali> patrickn: or above the top level, actually :)
[17:18:32] <patrickn> I received a folder named <database> and within are about 5 .json and 5 .bson files
[17:20:56] <AlexZan> what do you guys prefer, mongohq or mongolab or some other mongo host?
[17:22:36] <patrickn> optikalmouse: I'm using https://github.com/balderdashy/sails-mongo
[17:26:38] <optikalmouse> yeah, I'm pining for a relational db or at least SQL at the moment :/
[17:41:43] <patrickn> kali: thanks I've restored successfully into <database_name>, next step is assigning the database a user and password ( i think)
[18:27:53] <themime> using java, if i have subdoc thats an array, to save it do i need to manually iterate over the items and convert those also to BasicDBObjects?
[18:30:35] <themime> it seems like i need a embedded basicdbobjects which i actually just copy/pasted code for and may have just answered my own question. but if there is a way for it to be converted to a basicdbobject automatically thatd be nice
[18:30:55] <bilb_ono> after I have started switching around with dbs, how can I switch back? I want to switch back to the db named db but when I do use db, it connects to db db, I just want db
[18:33:58] <themime> thats powered 90% of my stuff
[18:34:03] <themime> ive only been using mongo for a few days
[18:35:30] <bilb_ono> Ive ben using it for a collective probably 3 days. spaced wayy to far apart. so I forget everything by the next time I need to use it again