migration.ts 687 B

123456789101112131415161718192021222324252627
  1. // 1. Connect to Neo4j database
  2. // 2. Connect to MongoDB database
  3. // HOSTS
  4. // 1. [NEO4J] Get all hosts
  5. // 2. [MONGODB] Create Hosts
  6. // USERS
  7. // 1. [NEO4J] Get all users
  8. // 2. [MONGODB] Upsert users
  9. // 3. [MONGODB] Update bannedBy
  10. // DOMAINS
  11. // 1. [NEO4J] Get all domains as stream
  12. // 2. [MONGODB] If domain has user, get user
  13. // 3. [MONGODB] Upsert domain
  14. // 4. [MONGODB] Update user to set domain
  15. // LINKS
  16. // 1. [NEO4J] Get all links as stream
  17. // 2. [MONGODB] If link has user and domain, get them
  18. // 3. [MONGODB] Upsert link
  19. // VISISTS
  20. // 1. [NEO4J] For every link get visists as stream
  21. // 2. [JAVaSCRIPT] Sum stats for each visist with the same date
  22. // 3. [MONGODB] Create visits