DocumentServer/NodeJsProjects/CoAuthoring/install/ConfigMongoDB.bat
nikolay ivanov a8be6b9e72 init repo
2014-07-05 18:22:49 +00:00

20 lines
578 B
Batchfile

ECHO OFF
SET DB_CONFIG_FILE=config_db.tmp
SET DB_NAME=coAuthoring
ECHO.
ECHO ----------------------------------------
ECHO Configure %DB_NAME% database
ECHO ----------------------------------------
ECHO db.createCollection("messages") > %DB_CONFIG_FILE%
ECHO db.messages.ensureIndex({"docid":1}) >> %DB_CONFIG_FILE%
ECHO db.createCollection("changes") >> %DB_CONFIG_FILE%
ECHO db.changes.ensureIndex({"docid":1}) >> %DB_CONFIG_FILE%
ECHO exit >> %DB_CONFIG_FILE%
call %~dp0..\mongodb\bin\mongo.exe %DB_NAME% < %DB_CONFIG_FILE% || exit /b 1
DEL /Q %DB_CONFIG_FILE%
exit /b 0