gpt4 book ai didi

javascript - 无法将js加载到MongoDB中

转载 作者:行者123 更新时间:2023-11-30 12:38:23 24 4
gpt4 key购买 nike

试图获得 this project在本地运行。

NPM 已安装。 Mongo 正在运行,但无法加载种子文件。

使用 mac OSX,我的终端输出是:

curtiss-mbp:CustomerManager curtiss$ mongo
MongoDB shell version: 2.7.4
connecting to: test
Server has startup warnings:
2014-08-16T18:28:54.115-0400 [initandlisten]
2014-08-16T18:28:54.115-0400 [initandlisten] ** NOTE: This is a development version (2.7.4) of MongoDB.
2014-08-16T18:28:54.115-0400 [initandlisten] ** Not recommended for production.
2014-08-16T18:28:54.115-0400 [initandlisten]
2014-08-16T18:28:54.115-0400 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-08-16T18:28:54.115-0400 [initandlisten]

use custmgr
switched to db custmgr
load("initMongoCustData.js")
2014-08-16T18:40:33.956-0400 Error: remove needs a query
at Error ()
at DBCollection.remove (src/mongo/shell/collection.js:299:31)
at initMongoCustData.js:65:14
at (shell):1:1 at src/mongo/shell/collection.js:299
2014-08-16T18:40:33.956-0400 Error: error loading js file: initMongoCustData.js
at (shell):1:1

无法将 js 加载到 MongoDB。我是否遗漏了什么或做错了什么?

最佳答案

Line 65在 initMongoCustData.js 中应该更改为

db.customers.remove();

db.customers.remove({});

关于javascript - 无法将js加载到MongoDB中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25344834/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com