migration.ts 758 B

123456789101112131415161718192021222324252627282930
  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 user
  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
  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. // 4. [MONGODB] Update user
  20. // 5. [MONGODB] Update domain
  21. // VISISTS
  22. // 1. [NEO4J] For every link get visists as stream
  23. // 2. [JAVaSCRIPT] Sum stats for each visist with the same date
  24. // 3. [MONGODB] Create visits
  25. // 4. [MONGODB] Update link