Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit e66c6fb

Browse files
authored
Fix database init issue (#915)
1 parent 9231e31 commit e66c6fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/management_api/initdb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function checkVersion (next) {
143143
var upgradeNext = function(next) {
144144
upgradeH264(function() {
145145
info = {_id: 1, version: currentVersion};
146-
db.collection('infos').save(info, function cb (e, s) {
146+
db.collection('infos').insertOne(info, function cb (e, s) {
147147
if (e) {
148148
console.log('mongodb: error in updating version');
149149
return client.close();
@@ -189,7 +189,7 @@ function prepareService (serviceName, next) {
189189
var crypto = require('crypto');
190190
var key = crypto.pbkdf2Sync(crypto.randomBytes(64).toString('hex'), crypto.randomBytes(32).toString('hex'), 4000, 128, 'sha256').toString('base64');
191191
service = {name: serviceName, key: cipher.encrypt(cipher.k, key), encrypted: true, rooms: [], __v: 0};
192-
db.collection('services').save(service, function cb (err, saved) {
192+
db.collection('services').insertOne(service, function cb (err, saved) {
193193
if (err) {
194194
console.log('mongodb: error in adding', serviceName);
195195
return client.close();

0 commit comments

Comments
 (0)