
from pymongo import ASCENDING, DESCENDING


db['nodelog'].create_index([
    ('__backrefs.logged.node.logs', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
    ('username', ASCENDING),
])

db['node'].create_index([
    ('is_deleted', ASCENDING),
    ('is_collection', ASCENDING),
    ('is_public', ASCENDING),
    ('institution_id', ASCENDING),
    ('is_registration', ASCENDING),
    ('contributors', ASCENDING),
])

db['node'].create_index([
    ('tags', ASCENDING),
    ('is_public', ASCENDING),
    ('is_deleted', ASCENDING),
    ('institution_id', ASCENDING),
])


from pymongo import ASCENDING, DESCENDING


db['user'].create_index([
    ('emails', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
    ('username', ASCENDING),
])

db['node'].create_index([
    ('is_deleted', ASCENDING),
    ('is_collection', ASCENDING),
    ('is_public', ASCENDING),
    ('institution_id', ASCENDING),
    ('is_registration', ASCENDING),
    ('contributors', ASCENDING),
])

db['node'].create_index([
    ('tags', ASCENDING),
    ('is_public', ASCENDING),
    ('is_deleted', ASCENDING),
    ('institution_id', ASCENDING),
])

Remove index on field that no longer exists
Remove index on field that no longer exists

[skip ci]

  
  from pymongo import ASCENDING, DESCENDING
  
- 
- db['nodelog'].create_index([
-     ('__backrefs.logged.node.logs', ASCENDING),
- ])
  
  db['user'].create_index([
      ('emails', ASCENDING),
  ])
  
  db['user'].create_index([
      ('emails', ASCENDING),
      ('username', ASCENDING),
  ])
  
  db['node'].create_index([
      ('is_deleted', ASCENDING),
      ('is_collection', ASCENDING),
      ('is_public', ASCENDING),
      ('institution_id', ASCENDING),
      ('is_registration', ASCENDING),
      ('contributors', ASCENDING),
  ])
  
  db['node'].create_index([
      ('tags', ASCENDING),
      ('is_public', ASCENDING),
      ('is_deleted', ASCENDING),
      ('institution_id', ASCENDING),
  ])
  
Remove index on field that no longer exists
## Code Before:

from pymongo import ASCENDING, DESCENDING


db['nodelog'].create_index([
    ('__backrefs.logged.node.logs', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
    ('username', ASCENDING),
])

db['node'].create_index([
    ('is_deleted', ASCENDING),
    ('is_collection', ASCENDING),
    ('is_public', ASCENDING),
    ('institution_id', ASCENDING),
    ('is_registration', ASCENDING),
    ('contributors', ASCENDING),
])

db['node'].create_index([
    ('tags', ASCENDING),
    ('is_public', ASCENDING),
    ('is_deleted', ASCENDING),
    ('institution_id', ASCENDING),
])

## Instruction:
Remove index on field that no longer exists
## Code After:

from pymongo import ASCENDING, DESCENDING


db['user'].create_index([
    ('emails', ASCENDING),
])

db['user'].create_index([
    ('emails', ASCENDING),
    ('username', ASCENDING),
])

db['node'].create_index([
    ('is_deleted', ASCENDING),
    ('is_collection', ASCENDING),
    ('is_public', ASCENDING),
    ('institution_id', ASCENDING),
    ('is_registration', ASCENDING),
    ('contributors', ASCENDING),
])

db['node'].create_index([
    ('tags', ASCENDING),
    ('is_public', ASCENDING),
    ('is_deleted', ASCENDING),
    ('institution_id', ASCENDING),
])
