Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

mongofiles put <the file>

Now I can see it by by running the command:


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
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
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

Your Answer


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.