Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Mongo Export
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Amar  
View profile  
 More options Sep 9 2012, 8:14 am
From: Amar <amarshiv...@gmail.com>
Date: Sun, 9 Sep 2012 05:14:58 -0700 (PDT)
Local: Sun, Sep 9 2012 8:14 am
Subject: Mongo Export

Hi All,

I am new to MongoDB. When I am using "*--directoryperdb*" option in *
MongoExport* I am getting an exception.

Here is the query what I am using
mongoexport.exe -f <FieldNames> --csv --dbpath
d:\devhome\tools\mongodb\data\db --directoryperdb

Error:
no collection specified!
Export MongoDB data to CSV, TSV or JSON files.

After that I specified a collection name, now my query is
mongoexport.exe -f <FieldNames> --csv --dbpath
d:\devhome\tools\mongodb\data\db --directoryperdb -c Person
Now I am getting
exported 0 records
Sun Sep 09 17:36:14 dbexit:
Sun Sep 09 17:36:14 [tools] shutdown: going to close listening sockets...
Sun Sep 09 17:36:14 [tools] shutdown: going to flush diaglog...
Sun Sep 09 17:36:14 [tools] shutdown: going to close sockets...
Sun Sep 09 17:36:14 [tools] shutdown: waiting for fs preallocator...
Sun Sep 09 17:36:14 [tools] shutdown: closing all files...
Sun Sep 09 17:36:14 [tools] closeAllFiles() finished
Sun Sep 09 17:36:14 [tools] shutdown: removing fs lock...
Sun Sep 09 17:36:14 dbexit: really exiting now

Here my doubt is how can we use *--directoryperdb* option. Could anyone
help me on this. I stuck over here.

Note: If I remove *--directoryperdb *I am able to export one collection(If
I specified dbname and collection name). How can we export all databases
using MongoExport.

Thanks & Regards,
Amar


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
मैं एक भारतीय बेवकूफ हूँ  
View profile  
 More options Sep 9 2012, 8:17 am
From: "मैं एक भारतीय बेवकूफ हूँ" <iamanindianid...@googlemail.com>
Date: Sun, 09 Sep 2012 14:17:27 +0200
Local: Sun, Sep 9 2012 8:17 am
Subject: Re: [mongodb-user] Mongo Export

Amar wrote:
> no collection specified!

Not clear enough?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Steneker  
View profile  
 More options Sep 9 2012, 8:38 am
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Sun, 9 Sep 2012 05:38:20 -0700 (PDT)
Local: Sun, Sep 9 2012 8:38 am
Subject: Re: Mongo Export

> I am new to MongoDB. When I am using "*--directoryperdb*" option in *
> MongoExport* I am getting an exception.

Hi,

The --directoryperdb option is meant to be used in conjunction with the
--dbpath option (which read from the data files directly).

You would only need to use --directoryperdb on a mongoexport if this option
was also used in your mongod config.

More typical usage would be to omit the --dbpath and connect to the mongod
server instead.

Here is the query what I am using

> mongoexport.exe -f <FieldNames> --csv --dbpath
> d:\devhome\tools\mongodb\data\db --directoryperdb

 The mongoexport tool is used to export a single collection to CSV, TSV, or
JSON so you must also specify one with -c:

   mongoexport.exe -f <FieldNames> --csv  -c collection

> Note: If I remove *--directoryperdb *I am able to export one
> collection(If I specified dbname and collection name). How can we export
> all databases using MongoExport.

If you want to export all databases, you should instead be using mongodump
/ mongorestore:

 http://www.mongodb.org/display/DOCS/Import+Export+Tools#ImportExportT...

Cheers,
Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amar shiva  
View profile  
 More options Sep 9 2012, 9:03 am
From: amar shiva <amarshiv...@gmail.com>
Date: Sun, 9 Sep 2012 18:32:51 +0530
Local: Sun, Sep 9 2012 9:02 am
Subject: Re: [mongodb-user] Re: Mongo Export

Hi Stephen,

Thanks for your reply. So what I understand was MongoExport will export one
collection(from one database) at a time. Is it right stephen..??????

So if we want to export all the databases we need to use "MONGO DUMP"
right??????

So if we export one collection at a time when this  *--directoryperdb* come
into picture. I didn't understand clearly. Could you please explain with
one example please.

Thanks & Regards,
Amar

On 9 September 2012 18:08, Stephen Steneker <stephen.stene...@10gen.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stephen Steneker  
View profile  
 More options Sep 9 2012, 10:26 pm
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Sun, 9 Sep 2012 19:26:34 -0700 (PDT)
Local: Sun, Sep 9 2012 10:26 pm
Subject: Re: [mongodb-user] Re: Mongo Export

> Thanks for your reply. So what I understand was MongoExport will export
> one collection(from one database) at a time. Is it right stephen..??????

Yes, mongoexport is for exporting one collection to a text format (CSV,
TSV, JSON).

So if we want to export all the databases we need to use "MONGO DUMP"

> right??????

If you want to backup and restore all of the collections and databases,
mongodump/mongorestore are the correct programs to use.

If you want to export each collection to a text format, you can use
mongoexport but you will have to call it once for every collection.

So if we export one collection at a time when this  *--directoryperdb* come

> into picture. I didn't understand clearly. Could you please explain with
> one example please.

You would only want to use this option if all of the following are true:

 - you are using --directoryperdb in your mongod configuration
 - you want to use --dbpath from mongoexport/mongodump (which reads the
data files directly instead of connecting to the mongo server)
 - you do not have a mongod currently using those db files

This is very likely *not* an option you want to use, which is why I
suggested you should not include it.

Cheers,
Stephen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amar shiva  
View profile  
 More options Sep 10 2012, 7:05 am
From: amar shiva <amarshiv...@gmail.com>
Date: Mon, 10 Sep 2012 16:35:40 +0530
Local: Mon, Sep 10 2012 7:05 am
Subject: Re: [mongodb-user] Re: Mongo Export

Hi Stephen,

Thanks for your detailed explanation.[?]

Thanks & Regards,
Amar

On 10 September 2012 07:56, Stephen Steneker <stephen.stene...@10gen.com>wrote:

  330.gif
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »