Search Results

Search found 1015 results on 41 pages for 'mongodb csharp'.

Page 12/41 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Unit Testing And Starting MongoDb Server

    - by azamsharp
    I am running some unit test that persist documents into the MongoDb database. For this unit test to succeed the MongoDb server must be started. I perform this by using Process.Start("mongod.exe"). It works but sometimes it takes time to start and before it even starts the unit test tries to run and FAILS. Unit test fails and complains that the mongodb server is not running. What to do in such situation?

    Read the article

  • Recovering data from mangodb raw files

    - by Jin Chen
    we use mongodb for our database and set the replset(two servers), but we mistakenly deleted some raw files that under /path/to/dbdata on both servers, after we used tool to get back the deleted files(we ran the extundelete on both server and mix the result together), like database.1, database.2 etc. we could not start the mongod, it raised the following error when starting mongod or executing mongodump, here is the console output: root@mongod:/opt/mongodb# mongodump --repair --dbpath /opt/mongodb -d database_production Thu Aug 21 16:22:43.258 [tools] warning: repair is a work in progress Thu Aug 21 16:22:43.258 [tools] going to try and recover data from: database_production Thu Aug 21 16:22:43.262 [tools] Assertion failure isOk() src/mongo/db/pdfile.h 392 0xde1b01 0xda42fd 0x8ae325 0x8ac492 0x8bd8e0 0x8c1c51 0x80e345 0x80e607 0x80e6a4 0x6db92a 0x6dc1ff 0x6e0db9 0xd9e45e 0x6ccdc7 0x7f499d856ead 0x6ccc29 mongodump(_ZN5mongo15printStackTraceERSo+0x21) [0xde1b01] mongodump(_ZN5mongo12verifyFailedEPKcS1_j+0xfd) [0xda42fd] mongodump(_ZNK5mongo7Forward4nextERKNS_7DiskLocE+0x1a5) [0x8ae325] mongodump(_ZN5mongo11BasicCursor7advanceEv+0x82) [0x8ac492] mongodump(_ZN5mongo8Database19clearTmpCollectionsEv+0x160) [0x8bd8e0] mongodump(_ZN5mongo14DatabaseHolder11getOrCreateERKSsS2_Rb+0x7b1) [0x8c1c51] mongodump(_ZN5mongo6Client7Context11_finishInitEv+0x65) [0x80e345] mongodump(_ZN5mongo6Client7ContextC1ERKSsS3_b+0x87) [0x80e607] mongodump(ZN5mongo6Client12WriteContextC1ERKSsS3+0x54) [0x80e6a4] mongodump(_ZN4Dump7_repairESs+0x3a) [0x6db92a] mongodump(_ZN4Dump6repairEv+0x2df) [0x6dc1ff] mongodump(_ZN4Dump3runEv+0x1b9) [0x6e0db9] mongodump(_ZN5mongo4Tool4mainEiPPc+0x13de) [0xd9e45e] mongodump(main+0x37) [0x6ccdc7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7f499d856ead] mongodump(__gxx_personality_v0+0x471) [0x6ccc29] assertion: 0 assertion src/mongo/db/pdfile.h:392 Thu Aug 21 16:22:43.271 dbexit: Thu Aug 21 16:22:43.271 [tools] shutdown: going to close listening sockets... Thu Aug 21 16:22:43.271 [tools] shutdown: going to flush diaglog... Thu Aug 21 16:22:43.271 [tools] shutdown: going to close sockets... Thu Aug 21 16:22:43.272 [tools] shutdown: waiting for fs preallocator... Thu Aug 21 16:22:43.272 [tools] shutdown: closing all files... Thu Aug 21 16:22:43.273 [tools] closeAllFiles() finished Thu Aug 21 16:22:43.273 [tools] shutdown: removing fs lock... Thu Aug 21 16:22:43.273 dbexit: really exiting now my env: 1) Debian 3.2.35-2 x86_64(it's a XEN virtual machine) 2) mongodb 2.4.6 and we did not delete the .0 and .ns files we tried to create a new database with the same name and copy these db.ns and db.2, db.3 to the new db, we still met the same error. is there any way to check the valid of raw .ns and datafiles, and how to recover the database?

    Read the article

  • Should a complete newbie use mongoose js? [on hold]

    - by Squirrl
    I drank from the koolaid and jumped aboard the node.js bandwagon even though I barely know javascript. That said, I have the opportunity to work with one of 2 templates. One is just node, express and mongodb, and the second includes mongoose and jade with the other 3 and is easier for me to understand. Yet I'm concerned that if I begin with mongoose, I'll be too high level and miss some of the fundamentals. Is my concern warranted? Should I work my way up or should I just start playing with all the toys from day one?

    Read the article

  • Moving from a traditional in memory Java session to persistent storage sessions

    - by Benju
    We have decided to take the plunge and move from using a typical java session provider in Tomcat/Jetty/etc to persisting everything to a central datastore. We are looking at using MongoDB for this. A few options come to mind... http://wiki.eclipse.org/Jetty/Tutorial/MongoDB_Session_Clustering This is nice because it will "auto-magically" persist our session to a Mongo installation. I am concerned however that we will not have fine grained control of what is happening. https://github.com/mattinsler/com.lowereast.guiceymongo/ GuiceMongo is interesting as it integrates with Guice. Perhaps we could persist everything via this ORM. Has anybody had to deal with this kind of move? It seems that moving from in memory to persistent session storage has a lot of gotchas.

    Read the article

  • In-memory DB to perform intersects on set slices

    - by IanC
    I have a specific programming need where I need to efficiently store large sorted sets in memory, query them for ranges, and intersect them against other sets that are also queried for ranged. I am looking at Redis, but I can't see a range slice command. MongoDB can only use 1 index, so it has to perform row-level scans, whereas I wish to process using columns that are intersected. I'm also looking at Counchbase, but can't easily determine from the documentation if it is suited to this. I know it uses Memcached, which is AFAIK not suited to this usage. Could anyone share potential solutions for this specific problem? EDIT For example, I need to perform the following: Get the IDs of all cars where the price is between 2000 and 3000, and intersect that will all cars where the engine capacity is between 3000 and 4000.

    Read the article

  • Mongodump on Gridfs is killing the host IOs

    - by Raphael
    I'm trying to make a mongodump from our production mongodb while the production is running. We have three production instances, one regular mongodb, one with very few gb of data on gridfs, one with a larger amount of data on gridfs. All mongodb instances are running in version 2.4.9 on a ubuntu 10.04 virtual server. I use a mongodump command to export the bases to another server. Unfortunately our machines are virtually hosted in a "low performances" datacenter (vmware based) so when I try to export the large gridfs db, the disk IO hits 100% (and 50% of the cpu starts waiting for IO too). This has a very negative impact on the production applicatiosn because db access time is excessively increased, making the applications unusable. I'm looking for a way to regulate the mongodump so the export goes slower but cooler on the hardware ressources allowing better performances for the applications to run. Has anyone had a similar scenario ?

    Read the article

  • How to choose between protobuf-csharp-port and protobuf-net

    - by PierrOz
    Hi Folks, I've recently had to look for a C# porting of the Protocole Buffer library originally developped by Google. And guess what, I found two projects owned both by two very well known persons here: protobuf-csharp-port, written by Jon Skeet and protobuf-net, written by Mark Gravell. My question is simple: which one do I have to choose ? I quite like Mark's solution as it seems to me closer to C# philisophy (for instance, you can just add attributes to the properties of existing class) and it looks like it can support .NET built-in types such as System.Guid. I am sure both of them are really great projects but what's your oppinion?

    Read the article

  • Rails and Mongoid best way to implement sharing system

    - by Matteo Pagliazzi
    I have to model User and Board in rails using mongoid as ODM. Each board is referenced to an user through a foreign key user_id and now I want to add the ability to share a board with other users. Following CRUD I'd create a new Model called something like Share and it's releated Controller with the ability to create/edit/delete a Share but I have some doubts: First, where to save informations about Shares? I think I may create a field in the Board's collection called shared_with including an array of user ids. in a MySQL I'd created a new table with the ids of who share, the resource shared and the user the resources is shared with but I don't think that's necessary using MongoDB. Every user a Board is shared with should be able to edit the Board (but not to delete it) so the Board should have two relations one with the owner and another with the users the board is shared with, right? For permission (the owner should be able to delete a board but the users it is shared with shouldn't) what to use? I'm using Devise for authentication but I think something like CanCan would fit better. but how to implement it? What do you think about this way? Do you find any problems or have better solutions?

    Read the article

  • How to query through a DBRef in MongoDB/pymongo?

    - by Soviut
    Is it possible to query through a DBRef using a single find spec? user collection { 'age': 30 } post collection { 'user': DBRef('user', ...) } Is it possible to query for all post who's users are 30 in a single find step? If not, would it be wise to create a javascript function to handle the multi-stage operation or will that cause blocking problems?

    Read the article

  • How to handle pagination queries properly with mongodb and php?

    - by luckytaxi
    Am I doing this right? I went to look at some old PHP code w/ MySQL and I've managed to get it to work, however I'm wondering if there's a much "cleaner" and "faster" way of accomplishing this. First I would need to get the total number of "documents" $total_documents = $collection->find(array("tags" => $tag, "seeking" => $this->session->userdata('gender'), "gender" => $this->session->userdata('seeking')))->count(); $skip = (int)($docs_per_page * ($page - 1)); $limit = $docs_per_page; $total_pages = ceil($total_documents / $limit); // Query to populate array so I can display with pagination $data['result'] = $collection->find(array("tags" => $tag, "seeking" => $this->session->userdata('gender'), "gender" => $this->session->userdata('seeking')))->limit($limit)->skip($skip)->sort(array("_id" => -1)); My question is, can I run the query in one shot? I'm basically running the same query twice, except the second time I'm passing the value to skip between records.

    Read the article

  • How to update a collection based on another collection in MongoDB?

    - by Sean Zhu
    Now I get two collections: coll01 and coll02. And the structure of coll01 is like this: { id: 01, name: "xxx", age: 30 } and the structure of coll02 is like: { id: 01, name: "XYZ" gender: "male" } The two id fields in the both collection are indices. And the numbers of documents in these two collections are same. And what I want to do in traditional SQL is : update coll01, coll02 set coll01.name = coll02.name where coll01.id = coll02.id

    Read the article

  • Memcachedb Versus MongoDB Versus CouchDB in terms of file based caching solution?

    - by Scott Faisal
    We need a caching solution that essentially caches data (text files) anywhere from 3 days up to a week based on user preferences and criteria. In this case memory based caching does not make sense to us. We were referred to MemcacheDB however I also thought of some NO SQL solutions. Our current application uses RDMS (MYSQL) and I guess it makes sense to use MemcacheDB however NOSQL does appeal as it is something more on the horizon. However we have not deployed a production level application under NOSQL and the beta stuff does not settle well with management/investors. Any how what are your thoughts and how would you address it? Thank You

    Read the article

  • How to write following MongoDB query in C# Driver?

    - by user3043457
    I wrote the exact query I need in Mongo console, but I'm having trouble rewriting it in C# driver. Here's a sample of the document, it's simple dictionary: { "_id" : ObjectId("539716bc101c588f941e2c27"), "_t" : "DictionaryDocument", "CsvSeparator" : ",", "SelectedAccounts" : "0", ... } Here's the query: db.settings.find({"SelectedAccounts" :{$exists:true}},{"SelectedAccounts":1, "_id":0} ) Now, I got the first part, Find with exists working, but how to write the second parameter in C# driver? I'd just like a single string as a result, not entire document. Here's C# code I got so far: _collection.FindOneAs(typeof(DictionaryDocument), Query.Exists(key)); key in this case is "SelectedAccounts". I'd like the query to filter and return only the data I need, I don't want to return all the results and search on the C# side. EDIT: I wouldn't mind if _id was passed back, but I don't need it. So only this part would work if it could be converted in C#: db.settings.find({"SelectedAccounts" :{$exists:true}},{"SelectedAccounts":1} )

    Read the article

  • Is it OK to mixed NumberLong and normal integers in the same field in MongoDB?

    - by Nicholas Tolley Cottrell
    I have been using Morphia to persistent objects from Java. I have also been running some batch processes from the console. I just realised that some values are now stored as NumberLong and number as plain Javascript numbers. I have an index on this field. Everything seems to be ok, but if I query: {f: 100} from the console it still returns the object even if it actually contains {f: NumberLong(100)} Is this true of all the drivers? It is best practice to avoid NumberLong is I can fit the value inside 32-bit? Will I save a lot of data and index space if I convert all NumberLongs to basic numbers?

    Read the article

  • Play! 1.2.5 with mongodb | Model Validation not happening

    - by TGV
    I have a simple User model whose fields are annotated with play validation annotations and morphia annotations like below. import play.data.validation.*; import play.modules.morphia.Model; import com.google.code.morphia.annotations.*; @Entity public class User extends Model{ @Id @Indexed(name="USERID", unique=true) public ObjectId userId; @Required public String userName; @Email @Indexed(name="USEREMAIL", unique=true) @Required public String userEmail; } Now I have a service which has a CreateNewUser method responsible for persisting the data. I have used Morphia plugin for the dao support. But the problem is that User Document gets persisted in mongo-db even if userName or userEmail is NULL. Also @Email validation does not happen // Below code is in app/controllers/Application.java User a = new User(); a.userName = "user1"; // calling bean to create user, userService is in app/service/UserService userService.createNewUser(a); It does not work even after adding @valid and validation.hasErrors() check.Below code is in app/service/UserService public void createNewUser(@Valid User user) { if (Validation.hasErrors()) { System.out.println("has errors"); } else { // TODO Auto-generated method stub userDao.save(user); } }

    Read the article

  • check status application pool iis7 with csharp (access-denied)

    - by jack
    I need to monitor the status of an application in the applications pool of IIS 7 from an other machine on the same domain. My monitoring application must be in C# and running as a Windows service. On my server, I create a user with administration rights and I execute the command aspnet_regiis -ga machine\username wich worked succesfully. My problem is when I try to access the application pool i still get COMExcepttion "Access denied". What did i do wrong or wich step did i miss? I used code from http://patelshailesh.com/index.php/create-a-website-application-pool-programmatically-using-csharp as example. int status = 0; string ipAddress = "10.20.2.13"; string username = "username"; string password = "password"; try { DirectoryEntry de = new DirectoryEntry(string.Format("IIS://{0}/W3SVC/AppPools/MyAppPoolName", ipAddress), username, password); //the exception is thron here. status = (int)de.InvokeGet("AppPoolState"); switch (status) { case 2: //Runnig break; case 4: //Stopped break; default: break; } } catch (Exception ex) { }

    Read the article

  • MS Build Server 2010 - Buffer Overflow

    - by user329005
    Hey everybody, I try to build an solution in MS Build Server (MS Visual Studio 2010 ver 10.0.30319.1) about ServerTasks - Builds - Server Task Builder - Queue new Built and go, 47 seconds later I get an error output: CSC: Unexpected error creating debug information file 'c:\Builds\1\ServerTasks\Server-Tasks Builder\Sources\ThirdParty\Sources\samus-mongodb-csharp-2b8934f\MongoDB.Linq\obj\Debug\MongoDB.Linq.PDB' -- 'c:\Builds\1\ServerTasks\Server-Tasks Builder\Sources\ThirdParty\Sources\samus-mongodb-csharp-2b8934f\MongoDB.Linq\obj\Debug\MongoDB.Linq.pdb: Access denied I checked the permissions of directory and set it (for debug purposes only) to grant access for all users, but still having an issue. Running the Procmon and filter file access for directory: 'c:\Builds\1\ServerTasks\Server-Tasks Builder\Sources\ThirdParty\Sources\samus-mongodb-csharp-2b8934f\MongoDB.Linq\obj\Debug\' tells me: 16:41:00,5449813 TFSBuildServiceHost.exe 3528 QuerySecurityFile C:\Builds\1\ServerTasks\Server-Tasks Builder\Sources\ThirdParty\Sources\samus-mongodb-csharp-2b8934f\MongoDB.Linq\obj\Debug BUFFER OVERFLOW Information: DACL, 0x20000000 and 16:41:00,5462119 TFSBuildServiceHost.exe 3528 QueryOpen C:\Builds\1\ServerTasks\Server-Tasks Builder\Sources\ThirdParty\Sources\samus-mongodb-csharp-2b8934f\MongoDB.Linq\obj\Debug FAST IO DISALLOWED Any ideas?

    Read the article

  • Uninstall Mongo DB completely

    - by Srikanth
    I followed the following steps to install MongoDb on my centos machine. http://andres.jaimes.net/876/setup-mongo-php-module-centos-6/ As mentioned at the end of the document, in the phpinfo() the mongoDb support was enabled. Now i need to undo all the actions i did. Till now i hve uninstalled remi-release-6.rpm which i had installed by following the link above. How to uninstall completely and undo all actions I did?

    Read the article

  • MongoDB in Go (golang) with mgo: How do I update a record, find out if update was successful and get the data in a single atomic operation?

    - by Sebastián Grignoli
    I am using mgo driver for MongoDB under Go. My application asks for a task (with just a record select in Mongo from a collection called "jobs") and then registers itself as an asignee to complete that task (an update to that same "job" record, setting itself as assignee). The program will be running on several machines, all talking to the same Mongo. When my program lists the available tasks and then picks one, other instances might have already obtained that assignment, and the current assignment would have failed. How can I get sure that the record I read and then update does or does not have a certain value (in this case, an assignee) at the time of being updated? I am trying to get one assignment, no matter wich one, so I think I should first select a pending task and try to assign it, keeping it just in the case the updating was successful. So, my query should be something like: "From all records on collection 'jobs', update just one that has asignee=null, setting my ID as the assignee. Then, give me that record so I could run the job." How could I express that with mgo driver for Go?

    Read the article

  • postgreSQL vs Cassandra vs MongoDB vs Voldemart ?

    - by ramonrails
    Which database to decide upon? Any comparisions? Existing: postgresql Issues Not easily scalable horizontal. Needs sharding etc Clustering does not solve the data growth problem Looking for: Any database that is easily horizontally scalable Cassandra (Twitter uses that?) MongoDB (rapidly gaining popularity) Voldemart Other? Why? Data growing with snowball effect existing postgresql locks table etc for vaccuum tasks periodically Archiving data is tideous currently Human interaction involved in existing archive, vaccuum, ... process periodically Need a 'set it. forget it. just add another server when data grows more.' type of solution

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >