Search Results

Search found 666 results on 27 pages for 'mongodb'.

Page 7/27 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • I cannot access my mongodb from internet ,Anybody can help me?

    - by VicoWu110
    I am using Mongodb database ,which is installed in my ubuntu with the ip address 126.22.252.25. The ubuntu version info is Ubuntu 12.04.3 LTS. My mongodb use the default 27017 port .On this local machine , I can use command "mongo --host 126.22.252.25" on the local machine to access, but I cannot use this command on any other linux mathine to access the db,nor can I use "telnet 126.22.252.25 27017" on my windows machine.I am sure 126.22.252.25 machine is accessable from internet because I can use winSCP and secureCRT to login to it.I run command "netstat -tnlp" , it shows below: tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN I have already change the /ect/mongodb.conf file , modifying bind_ip parameter from 0.0.0.0 to 126.22.252.25 So ,anyone can help me?

    Read the article

  • How do I network this Windows Failover Cluster and MongoDB Replica Set? (diagram inside)

    - by arex1337
    As you can see, my two Windows Server Failover Cluster (WSFC) nodes have three network interfaces each, which connects them to three different networks : A public network A private network consisting of the WSFC nodes A private network consisting of the WSFC nodes and a machine with the WSFC Quorum Witness File Share Does this network configuration I've planned, make sense? Do I have the "right" number of NICs and networks? I'm thinking the 2nd NIC/network may be unnecessary. My two MongoDB Replica Set nodes also have three network interfaces each - very similar to the previous situation: A public network A private network consisting of the primary and secondary MongoDB Replica Set nodes A private network consisting of the primary, secondary and arbiter MongoDB Replica Set nodes Does this network configuration, make sense? Do I have the "right" number of NICs and networks? I'm thinking the 2nd NIC/network may be unnecessary. Here is the simpler version I'm considering: UPDATE:

    Read the article

  • What database systems should an startup company consider?

    - by Am
    Right now I'm developing the prototype of a web application that aggregates large number of text entries from a large number of users. This data must be frequently displayed back and often updated. At the moment I store the content inside a MySQL database and use NHibernate ORM layer to interact with the DB. I've got a table defined for users, roles, submissions, tags, notifications and etc. I like this solution because it works well and my code looks nice and sane, but I'm also worried about how MySQL will perform once the size of our database reaches a significant number. I feel that it may struggle performing join operations fast enough. This has made me think about non-relational database system such as MongoDB, CouchDB, Cassandra or Hadoop. Unfortunately I have no experience with either. I've read some good reviews on MongoDB and it looks interesting. I'm happy to spend the time and learn if one turns out to be the way to go. I'd much appreciate any one offering points or issues to consider when going with none relational dbms?

    Read the article

  • Saving in mongoDb with Mongoose, unexpected elements saved

    - by guiomie
    When I write in my mongoDB with mongoose the operation is treated with success, my document is saved, but there is also all kind of weird other sutff written down. It seems to be mongoose code. What could cause this? I add stuff in a specific array with: resultReference.ref[arrayLocation].allEvents.push(theEvent); {id: 11, allEvents: [] } is the structure of a ref element, and I push theEvent in the allEvents array. I then resultReference.save() I use express, mongoose and mongoHQ for database. I tried on a local mongo server, and this annoyance is still there. I've print in my console the document to write before save() and non of this weird code is there. { id 11 allEvents [ 0 { _events { maxListeners 0 } _doc { _id {"$oid": "4eb87834f54944e263000003"} title "Test" allDay false start 2011-11-10 13:00:00 UTC end 2011-11-10 15:00:00 UTC url "/test/4eb87834f54944e263000002" color "#99CCFF" ref "4eb87834f54944e263000002" } _activePaths { paths { title "modify" allDay "modify" start "modify" end "modify" url "modify" color "modify" ref "modify" } states { init { } modify { title true allDay true start true end true url true color true ref true } require { } } stateNames [ 0 "require" 1 "modify" 2 "init" ] } _saveError null _validationError null isNew true _pres { save [ 0 function (next) { // we keep the error semaphore to make sure we don't // call `save` unnecessarily (we only need 1 error) var subdocs = 0 , error = false , self = this; var arrays = this._activePaths .map('init', 'modify', function (i) { return self.getValue(i); }) .filter(function (val) { return (val && val instanceof DocumentArray && val.length); }); if (!arrays.length) return next(); arrays.forEach(function (array) { subdocs += array.length; array.forEach(function (value) { if (!error) value.save(function (err) { if (!error) { if (err) { error = true; next(err); } else --subdocs || next(); } }); }); }); } 1 "function checkForExistingErrors(next) { if (self._saveError){ next(self._saveError); self._saveError = null; } else { next(); } }" 2 "function validation(next) { return self.validate.call(self, next); }" ] } _posts { save [ ] } save function () { var self = this , hookArgs // arguments eventually passed to the hook - are mutable , lastArg = arguments[arguments.length-1] , pres = this._pres[name] , posts = this._posts[name] , _total = pres.length , _current = -1 , _asyncsLeft = proto[name].numAsyncPres , _next = function () { if (arguments[0] instanceof Error) { return handleError(arguments[0]); } var _args = Array.prototype.slice.call(arguments) , currPre , preArgs; if (_args.length && !(arguments[0] === null && typeof lastArg === 'function')) hookArgs = _args; if (++_current < _total) { currPre = pres[_current] if (currPre.isAsync && currPre.length < 2) throw new Error("Your pre must have next and done arguments -- e.g., function (next, done, ...)"); if (currPre.length < 1) throw new Error("Your pre must have a next argument -- e.g., function (next, ...)"); preArgs = (currPre.isAsync ? [once(_next), once(_asyncsDone)] : [once(_next)]).concat(hookArgs); return currPre.apply(self, preArgs); } else if (!proto[name].numAsyncPres) { return _done.apply(self, hookArgs); } } , _done = function () { var args_ = Array.prototype.slice.call(arguments) , ret, total_, current_, next_, done_, postArgs; if (_current === _total) { ret = fn.apply(self, args_); total_ = posts.length; current_ = -1; next_ = function () { if (arguments[0] instanceof Error) { return handleError(arguments[0]); } var args_ = Array.prototype.slice.call(arguments, 1) , currPost , postArgs; if (args_.length) hookArgs = args_; if (++current_ < total_) { currPost = posts[current_] if (currPost.length < 1) throw new Error("Your post must have a next argument -- e.g., function (next, ...)"); postArgs = [once(next_)].concat(hookArgs); return currPost.apply(self, postArgs); } }; if (total_) return next_(); return ret; } }; if (_asyncsLeft) { function _asyncsDone (err) { if (err && err instanceof Error) { return handleError(err); } --_asyncsLeft || _done.apply(self, hookArgs); } } function handleError (err) { if ('function' == typeof lastArg) return lastArg(err); if (errorCb) return errorCb.call(self, err); throw err; } return _next.apply(this, arguments); } errors null } ] } ]

    Read the article

  • directoryperdb issue

    - by Rich Blumer
    I installed MongoDB to run as a Windows Service on Win 7 and everything runs well. However, when I attempt to use the command --directoryperdb, it does not recognize this command. Does anyone know how to resolve this issue?

    Read the article

  • MongoDB, Carrierwave, GridFS and prevention of files' duplication

    - by Arkan
    I am dealing with Mongoid, carrierwave and gridFS to store my uploads. For example, I have a model Article, containing a file upload(a picture). class Article include Mongoid::Document field :title, :type => String field :content, :type => String mount_uploader :asset, AssetUploader end But I would like to only store the file once, in the case where I'll upload many times the same file for differents articles. I saw GridFS has a MD5 checksum. What would be the best way to prevent duplication of identicals files ? Thanks

    Read the article

  • MongoDB-PHP: JOIN-like query

    - by mdm414
    Here are the objects: courses { "name" : "Biology", "_id" : ObjectId("4b0552b0f0da7d1eb6f126a1") } students { "name" : "Joe", "classes" : [ { "$ref" : "courses", "$id" : ObjectId("4b0552b0f0da7d1eb6f126a1") } ], "_id" : ObjectId("4b0552e4f0da7d1eb6f126a2") } Using the PHP Mongo Class, how do I get all the students that has a biology course? Thanks

    Read the article

  • MongoDB architectural question

    - by pex
    I have to store 4 Models. Let's say a Post that has many and belongs to many Categories. Category on the other hand has many Qualities. At the moment I'm of the opinion, that Post and Categories are Documents. Qualities becomes an EmbeddedDocument of Categories. We're coming to the root problem: There are a lot of Votes on Qualities that belong to a Post. I thought about embed Votes in Post and give it a quality_id. I am really expecting a lot of Votes and there has to be a possibility to filter them (e.g by Username / Usergroup / Date voted). I worked with MongoMapper and I think the missing existence of find methods for EmbeddedDocuments could become a killer. On the other hand I'm wondering about performance issues. What if I want to provide a Post without all the Votes, but only a few. Or, what if I define an own Document for Votes and have tons of Vote-Documents? Wouldn't that become a performance killer?

    Read the article

  • Problem with MongoDB Ruby Driver

    - by Paul
    I'm on Ubuntu, and I've done install gem mongo which reported Successfully installed bson-1.0 Successfully installed mongo-1.0 2 gems installed I've started mongod Now I cd to the mongo gem directory and try > ruby examples/simple.rb and I get the error ./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (LoadError) from ./examples/../lib/mongo.rb:31 from examples/simple.rb:3:in `require' from examples/simple.rb:3 which I can't make sense of, since the bson gem is installed > gem list *** LOCAL GEMS *** bson (1.0) bson_ext (1.0) mongo (1.0) rack (1.1.0) sinatra (1.0) Any suggestions what's up here?

    Read the article

  • MongoDB - proper use of collections?

    - by zmg
    In Mongo my understanding is that you can have databases and collections. I'm working on a social-type app that will have blogs and comments (among other things) and had previously be using MySQL and pretty heavy partitioning in an attempt to limit possible concurrency issues. With MySQL I've stuffed all my user data into a _user database with several tables to further partition the data (blogs, pages, etc). My immediate reaction with Mongo would be to create a 'users' database with one collection per user. In this way user 'zach' blog entries would go into the 'zach' collection with associated comments and such becoming sub-objects in the same collection. Basically like dynamically creating one table per user in MySQL, but apparently without the complexity and limitations that might impose. Of course since I haven't really used Mongo before I'm having trouble gauging the (ahem..) quality of this idea and the potential problems it might cause down the road. I'd like user data to be treated a lot like a users directory in a *nix environment where user created/non-shared (mostly) gets put into one place (currently with MySQL that would be the appname_users as mentioned above). Most of the users data will be specific to the users page(s). Some of the user data which is queried across all site users (searchable user profiles) is currently kept in a separate database/table and I expect things like this could be put into a appname_system database and be broken up into collections and/or application specific databases (appname_profiles). Anyway, since the available documentation on this is currently a little thin and my experience is extremely limited I thought I might find a little guidance from someone with a better working understanding of the system. On the plus side I'd really already been attempting to treat MySQL as a schema-less document-store and doing this with Mongo seems much more intuitive/sane/rational so I'm really looking forward to getting started. Thanks, Zach

    Read the article

  • MongoDB ruby dates

    - by MB
    I have a collection with an index on :created_at (which in this particular case should be a date) From rails what is the proper way to save an entry and then retrieve it by the date? I'm trying something like: Model: field :created_at, :type = Time script: Col.create(:created_at = Time.parse(another_model.created_at).to_s and Col.find(:all, :conditions = { :created_at = Time.parse(same thing) }) and it's not returning anything

    Read the article

  • Intersection of sets Mongodb

    - by afvasd
    Hi everyone I am new to mongo, this is my db design: product := { name: str group: ref, comments: [ ref, ref, ref, ref ] } comments := { ... a bunch of comments stuff } tag := { _id: int, #Need this for online requests tag: str, products: [ {product: ref, score: float}, ... ], comments: [ {comment: ref, score: float}, ...], } So my usage pattern is: GIVEN a product, find comments that have certain tag and sort them accordingly. My current approach involves: Look for that tag object that has tag=myTag pull all the comments out, sorted look for that product where product.name=myProduct pull all the comments out (which are dbrefs by the way) loop through the result of 2, and checking if they are in 4, (this I can do a limit 10) etc. It's pretty inefficient. Any better methods?

    Read the article

  • Mongodb using db.help() on a particular db command

    - by user1325696
    When I type db.help() It returns DB methods: db.addUser(username, password[, readOnly=false]) db.auth(username, password) ... ... db.printShardingStatus() ... ... db.fsyncLock() flush data to disk and lock server for backups db.fsyncUnock() unlocks server following a db.fsyncLock() I'd like to find out how to get more detailed help for the particular command. The problem was with the printShardingStatus as it returned "too many chunks to print, use verbose if you want to print" mongos> db.printShardingStatus() --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3 } shards: { "_id" : "shard0000", "host" : "localhost:10001" } { "_id" : "shard0001", "host" : "localhost:10002" } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "dbTest", "partitioned" : true, "primary" : "shard0000" } dbTest.things chunks: shard0001 12 shard0000 19 too many chunks to print, use verbose if you want to for ce print I found that for that particular command I can specify boolean parameter db.printShardingStatus(true) which wasn't shown using db.help().

    Read the article

  • Can't append to array using string field name [$] when performing update on array fields

    - by Haraldo
    rowsI am attempting to perform a mongodb update on each field in an array of records. An example schema is below: { "_id" : ObjectId("508710f16dc636ec07000022"), "summary" : "", "uid" : "ABCDEF", "username" : "bigcheese", "name" : "Name of this document", "status_id" : 0, "rows" : [ { "score" : 12, "status_id" : 0, "uid" : 1 }, { "score" : 51, "status_id" : 0, "uid" : 2 } ] } So far I have been able to perform single updates like this: db.mycollection.update({"uid":"ABCDEF","rows.uid":1}, {$set:{"rows.$.status_id":1}},false,false) However, I am struggling as to how to perform an update that will update all array records to a status_id of 1 (for instance). Below is how I imagine it should work: db.mycollection.update({"uid":"ABCDEF"}, {$set:{"rows.$.status_id":1}},false,true) However I get the error: can't append to array using string field name [$] I have tried for quite a while with no luck. Any pointers?

    Read the article

  • MongoDb - $match filter not working in subdocument

    - by Ranjith
    This is Collection Structure [{ "_id" : "....", "name" : "aaaa", "level_max_leaves" : [ { level : "ObjectIdString 1", max_leaves : 4, } ] }, { "_id" : "....", "name" : "bbbb", "level_max_leaves" : [ { level : "ObjectIdString 2", max_leaves : 2, } ] }] I need to find the subdocument value of level_max_leaves.level filter when its matching with given input value. And this how I tried, For example, var empLevelId = 'ObjectIdString 1' ; MyModel.aggregate( {$unwind: "$level_max_leaves"}, {$match: {"$level_max_leaves.level": empLevelId } }, {$group: { "_id": "$level_max_leaves.level", "total": { "$sum": "$level_max_leaves.max_leaves" }}}, function (err, res) { console.log(res); }); But here the $match filter is not working. I can't find out exact results of ObjectIdString 1 If I filter with name field, its working fine. like this, {$match: {"$name": "aaaa" } }, But in subdocument level its returns 0. {$match: {"$level_max_leaves.level": "ObjectIdString 1"} }, My expected result was, { "_id" : "ObjectIdString 1", "total" : 4, }

    Read the article

  • Mongodb querying for multiple parameters

    - by gaggina
    I've this collections { "name" : "montalto", "users" : [ { "username" : "ciccio", "email" : "aaaaaaaa", "password" : "aaaaaaaa", "money" : 0 } ], "numers" : "8", "_id" : ObjectId("5040d3fded299bf03a000002") } If I want to search for a collection with the name of montalto and a user named ciccio I'm using the following query: db.coll.find({name:'montalto', users:{username:'ciccio'}}).count() But it does not work. Where I went wrong?

    Read the article

  • MongoDB efficient dealing with embedded documents

    - by Sebastian Nowak
    I have serious trouble finding anything useful in Mongo documentation about dealing with embedded documents. Let's say I have a following schema: { _id: ObjectId, ... data: [ { _childId: ObjectId // let's use custom name so we can distinguish them ... } ] } What's the most efficient way to remove everything inside data for particular _id? What's the most efficient way to remove embedded document with particular _childId inside given _id? What's the performance here, can _childId be indexed in order to achieve logarithmic (or similar) complexity instead of linear lookup? If so, how? What's the most efficient way to insert a lot of (let's say a 1000) documents into data for given _id? And like above, can we get O(n log n) or similar complexity with proper indexing? What's the most efficient way to get the count of documents inside data for given _id?

    Read the article

  • MongoDB complex MapReduce of video logs

    - by Justin Hourigan
    I have a dataset from video streaming logs. Each video is identified by a FileGUID. The log entries record the FileGUID, the fragment of the video watched and the bandwidth it was watched at. I would like to create a mapreduce outputting, for each video, a count for fragments both total and for each bandwidth. Ideally it would look like; {"FileGUID":"50acb3a5796634df0e073285", { "1":{"total":76, "0832":34, "1028":42}, "2":{"total":42, "0832":28, "1028":14}, ... } } Is this possible with one mapreduce or is it a multi-step process, or should I use a different method? Here is a sample of the data. { "_id": ObjectId("50acb3a5796634df0e073285"), "IP": "46.7.1.88", "DateTime": ISODate("2012-10-24T22:59:57.0Z"), "FileGUID": "8cdde821fb934a6da7c125a012a26612", "Bandwidth": NumberInt(1028), "Segment": NumberInt(1), "Fragment": NumberInt(237), "Status": NumberInt(200), "Size": NumberInt(576790), "UserAgent": "Mozilla\/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko\/20100101 Firefox\/16.0" } { "_id": ObjectId("50acb3a5796634df0e073284"), "IP": "46.7.1.88", "DateTime": ISODate("2012-10-24T22:59:52.0Z"), "FileGUID": "8cdde821fb934a6da7c125a012a26612", "Bandwidth": NumberInt(1028), "Segment": NumberInt(1), "Fragment": NumberInt(236), "Status": NumberInt(200), "Size": NumberInt(577100), "UserAgent": "Mozilla\/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko\/20100101 Firefox\/16.0" } { "_id": ObjectId("50acb3a5796634df0e073283"), "IP": "46.7.1.88", "DateTime": ISODate("2012-10-24T22:59:47.0Z"), "FileGUID": "8cdde821fb934a6da7c125a012a26612", "Bandwidth": NumberInt(0832), "Segment": NumberInt(1), "Fragment": NumberInt(234), "Status": NumberInt(200), "Size": NumberInt(576664), "UserAgent": "Mozilla\/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko\/20100101 Firefox\/16.0" } { "_id": ObjectId("50acb3a5796634df0e073282"), "IP": "46.7.1.88", "DateTime": ISODate("2012-10-24T22:59:42.0Z"), "FileGUID": "8cdde821fb934a6da7c125a012a26612", "Bandwidth": NumberInt(0832), "Segment": NumberInt(1), "Fragment": NumberInt(233), "Status": NumberInt(200), "Size": NumberInt(575692), "UserAgent": "Mozilla\/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko\/20100101 Firefox\/16.0" }

    Read the article

  • mongoDB many to many with one query?

    - by PowderKeg
    in mysql i use JOIN and one query is no problem. what about mongo? imagine categories and products. products may have more categories. categories may have more product. (many to many structure) and administrator may edit categories in administration (categories must be separated) its possible write product with categories names in one query? i used this structure categories { name:"categoryName", product_id:["4b5783300334000000000aa9","5783300334000000000aa943","6c6793300334001000000006"] } products { name:"productName", category_id:["4b5783300334000000000bb9","5783300334000000000bb943","6c6793300334001000000116"] } now i can simply get all product categories, and product in some category and categories alone for editation. but if i want write product with categories names i need two queries - one to get product categories id and second to get categories names from categories by that ids. is this the right way? or this structure is unsuitable? i would like to have only one query but i dont know if its possible.

    Read the article

  • MongoDB lists with paginations?

    - by Timmy
    for documents with lists with pagination, is it better to embed or use reference? im reading the custom type "SONManipulator" and it appears to transform every thing on retrieval, even the sub docs. i want to keep the list in the document sorted, should this impact anything?

    Read the article

  • mongoose updating a field in a MongoDB not working

    - by Masiar
    I have this code var UserSchema = new Schema({ Username: {type: String, index: true}, Password: String, Email: String, Points: {type: Number, default: 0} }); [...] var User = db.model('User'); /* * Function to save the points in the user's account */ function savePoints(name, points){ if(name != "unregistered user"){ User.find({Username: name}, function(err, users){ var oldPoints = users[0].Points; var newPoints = oldPoints + points; User.update({name: name}, { $inc: {Points: newPoints}}, function(err){ if(err){ console.log("some error happened when update"); } else{ console.log("update successfull! with name = " + name); User.find({Username: name}, function(err, users) { console.log("updated : " + users[0].Points); }); } }); }); } } savePoints("Masiar", 666); I would like to update my user (by finding it with its name) by updating his/her points. I'm sure oldPoints and points contain a value, but still my user keep being at zero points. The console prints "update successful". What am I doing wrong? Sorry for the stupid / noob question. Masiar

    Read the article

  • meteor mongodb _id changing after insert (and UUID property as well)

    - by lommaj
    I have meteor method that does an insert. Im using Regulate.js for form validation. I set the game_id field to Meteor.uuid() to create a unique value that I also route to /game_show/:game_id using iron router. As you can see I'm logging the details of the game, this works fine. (image link to log below) Meteor.methods({ create_game_form : function(data){ Regulate.create_game_form.validate(data, function (error, data) { if (error) { console.log('Server side validation failed.'); } else { console.log('Server side validation passed!'); // Save data to database or whatever... //console.log(data[0].value); var new_game = { game_id: Meteor.uuid(), name : data[0].value, game_type: data[1].value, creator_user_id: Meteor.userId(), user_name: Meteor.user().profile.name, created: new Date() }; console.log("NEW GAME BEFORE INSERT: ", new_game); GamesData.insert(new_game, function(error, new_id){ console.log("GAMES NEW MONGO ID: ", new_id) var game_data = GamesData.findOne({_id: new_id}); console.log('NEW GAME AFTER INSERT: ', game_data); Session.set('CURRENT_GAME', game_data); }); } }); } }); All of the data coming out of the console.log at this point works fine After this method call the client routes to /game_show/:game_id Meteor.call('create_game_form', data, function(error){ if(error){ return alert(error.reason); } //console.log("post insert data for routing variable " ,data); var created_game = Session.get('CURRENT_GAME'); console.log("Session Game ", created_game); Router.go('game_show', {game_id: created_game.game_id}); }); On this view, I try to load the document with the game_id I just inserted Template.game_start.helpers({ game_info: function(){ console.log(this.game_id); var game_data = GamesData.find({game_id: this.game_id}); console.log("trying to load via UUID ", game_data); return game_data; } }); sorry cant upload images... :-( https://www.evernote.com/shard/s21/sh/c07e8047-de93-4d08-9dc7-dae51668bdec/a8baf89a09e55f8902549e79f136fd45 As you can see from the image of the console log below, everything matches the id logged before insert the id logged in the insert callback using findOne() the id passed in the url However the mongo ID and the UUID I inserted ARE NOT THERE, the only document in there has all the other fields matching except those two! Not sure what im doing wrong. Thanks!

    Read the article

  • when to index on multiple keys in mongodb

    - by Evan
    say I have an Item document with :price and :qty fields. I sometimes want to find all documents matching a given :price AND :qty, and at other times it will be either :price on its own or :qty on its own. I have already indexed the :price and :qty keys, but do I also need to create a compound index on both together or are the single key indexes enough?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >