Changes

Jump to navigation Jump to search
New doc to import MongoDB dump
Line 184: Line 184:     
==== Import Open Food Facts MongoDB dump into MongoDB ====
 
==== Import Open Food Facts MongoDB dump into MongoDB ====
 +
<pre>
 +
# Download
 +
wget https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.gz
 +
 +
# Import (no need to uncompress)
 +
# --nsFrom=off.products          # source of the database / collection
 +
# --nsTo=mydatabase.mycollection  # local database / collection
 +
# --drop                          # Before restoring the collections from the dumped backup, drops the collections from the target database.
 +
#                                # --drop does not drop collections that are not in the backup.
 +
mongorestore -vvvvv  --gzip --archive="./openfoodfacts-mongodbdump.gz" --nsFrom=off.products --nsTo=mydatabase.mycollection --drop
 +
</pre>
 +
 +
==== (Deprecated) Import Open Food Facts MongoDB dump into MongoDB ====
 
<pre>
 
<pre>
 
# Download and decompress the dump
 
# Download and decompress the dump

Navigation menu