Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've added a file to mongodb's GridFS using:

mongofiles put <the file>

Now I can see it by by running the command:

db.fs.chunks.find()

Only if I'm using the test database, when I use a custom database, the second command returns nothing. Is mongodb using test as the default database for storing files? Is there a way to specify this?

share|improve this question
1  
I get it now. When I run the first command it uses test as default database since I didn't specify any. To specify my database I have to use -d flag like: mongofiles -d <database name> now when I use my database, db.fs.chunks.find() returns something useful. Unfortunately I can't answer my own question since I have yet a small reputation. –  Marconi Jun 12 '11 at 7:42
add comment

1 Answer

up vote 2 down vote accepted

Is mongodb using test as the default database for storing files?

Yes, test is the default database.

Is there a way to specify this?

Yes. This will vary by driver. If you're doing it from the command line you can connect to servername:port/databasename. There's also typically a -d option for specifying the DB name.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.