File size: 320 Bytes
dc510b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
db = db.getSiblingDB('erp_datasource');

db.createUser({
  user: 'erpuser',
  pwd: 'erppass',
  roles: [
    {
      role: 'readWrite',
      db: 'erp_datasource'
    }
  ]
});

db.createCollection('products');
db.createCollection('orders');
db.createCollection('customers');

print('MongoDB initialization completed');