Mongodb[js]未捕获异常:SyntaxError:标识符在数值文本之后立即启动
我有一个名为:ec2_list-07-26-2020的MongoDB集合 如果我尝试对其执行查找或验证之类的典型操作,则会出现以下错误:Mongodb[js]未捕获异常:SyntaxError:标识符在数值文本之后立即启动,mongodb,Mongodb,我有一个名为:ec2_list-07-26-2020的MongoDB集合 如果我尝试对其执行查找或验证之类的典型操作,则会出现以下错误: db.ec2_list-07-26-2020.find() 2020-07-26T20:17:16.845-0400 E QUERY [js] uncaught exception: SyntaxError: identifier starts immediately after numeric literal : @(shell):1:18 所以我
db.ec2_list-07-26-2020.find()
2020-07-26T20:17:16.845-0400 E QUERY [js] uncaught exception: SyntaxError: identifier starts immediately after numeric literal :
@(shell):1:18
所以我创建了一个名为audit00的测试集合。当我在该系列上执行相同操作时,效果很好:
db.audit00.find()
{ "_id" : ObjectId("5f1e1e02807681425a06fa07"), "writeConcern" : "yes", "ordered" : "True" }
以及:
我命名收藏的方式是否有问题,需要更改?我认为您的收藏名称没有问题。它没有违反任何法律 以下命令应在mongo shell中工作: 或
我认为你的收藏名称没有任何问题。它没有违反任何法律 以下命令应在mongo shell中工作: 或
db.audit00.validate()
{
"ns" : "aws_inventories.audit00",
"nInvalidDocuments" : NumberLong(0),
"nrecords" : 1,
"nIndexes" : 1,
"keysPerIndex" : {
"_id_" : 1
},
"valid" : true,
"warnings" : [
"Some checks omitted for speed. use {full:true} option to do more thorough scan."
],
"errors" : [ ],
"extraIndexEntries" : [ ],
"missingIndexEntries" : [ ],
"ok" : 1
}
const col = db.getCollection("ec2_list-07-26-2020")
col.find()
db["ec2_list-07-26-2020"].find()