#sqlite #mongo-db #import #field #path #uri

app sqlite2mongo

Import sqlite database to mongodb

3 releases (breaking)

0.3.0 Mar 3, 2022
0.2.0 May 5, 2021
0.1.0 Dec 13, 2020

#2027 in Database interfaces

MIT license

18KB
128 lines

Crates.io

Import sqlite database to mongodb.

Usage

USAGE:
    sqlite2mongo.exe [FLAGS] <sqlite-path> <mongodb-uri> <mongo-database>

FLAGS:
        --dry-run       Test reading sqlite data, do not create mongodb collection
    -h, --help          Prints help information
        --lower-camel   Convert field name to lower camel case
    -V, --version       Prints version information

ARGS:
    <sqlite-path>       Sqlite data file path
    <mongodb-uri>       Mongodb URI
    <mongo-database>    Database name to save the imported data

Example:

sqlite2mongo sqlite://D:/Database/mydb.db?mode=ro mongodb://localhost:27017 mydb --lower-camel

Differences to sqlitemongo

  • New ObjectId is generated for _id field.
  • DateTime, Boolean field types are reserved.
  • Supports dry-run and convert field name to mixed case.

Dependencies

~67MB
~1.5M SLoC