Skip to content

HMarzban/ganjoor-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ganjoor migration mysql db to mongodb

Note: before hit yarn start be sure to import ./db/dump.sql.gz to your local database

$ yarn i            # install dependency

$ yarn start        # start the migration process
$ yarn export:db    # export ganjoor mongodb dataset
$ yarn import:db    # import ganjoor mongodb dataset to your local db
$ yarn import:sql   # import ganjoor mysql database to your local db

Collection Schema

It has two collections Poets and Verses

Poets collection schema

[
  {
    "_id" : ObjectId,
    "desc" : String,
    "name" : String,
    "poems" : [
      {
        "_id" : ObjectId,
        "name" : String,
        "slug" : String
      },
      ...
    ]
  }
]

Verses collection schema

[
  {
    "_id": ObjectId,
    "tile": String,
    "slug": String,
    "poemId": ObjectId,
    "poet": {
      "_id": ObjectId
      "name": String
    }
    "verses": [
      {
        "text": String
      },
      ...
    ]
  }
]

More about ganjoor open source project

About

ganjoor.net database migration to mongodb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published