db.FirstTry.update({"id":1},{$set:{"Name":"Selvah"}});
我犯了这样的错误
{“message”:“WriteError({'code':10003,'index':0,'errmsg':'Cannot change the size of a document in a capped collection:72!=71','op':{'q':{'id':1},'u':{'set':{'Name':'Selvah'},'multi':false,'upsert':false},'stack:“script:1:13}”
我想这解决了你的问题http://www.solidsyntax.be/2016/03/26/MongoDB-Cannot-change-the-size-of-a-document-in-a-capped-collection/
官方文档列出了有关使用封顶收藏的信息:https://docs.mongodb.com/manual/core/capped-collections/#restrictions-和建议
封顶集合中文档的大小是固定的,因此不能在文档中插入新字段。您必须创建一个新的临时集合,将所有数据从旧集合复制到新集合,并添加新字段。
大概是这样的:
db.createCollection( "logItems_temp", { capped: true, size: 100000 } )
var cur = db.logItems.find()
while (cur.hasNext()) {
logItem = cur.next();
if(logItem.name == null){
logItem.name = selvah;
}
db.logItems_temp.insert(logItem);
}
db.logItems.drop()
db.logItems_temp.renameCollection("logItems")
我的android工作室刚刚更新了,之后我的应用程序就不能再编译了。它显示以下错误: 任务“:app:ProcessDebugManifest”执行失败。
错误在: "公共类MapsActive扩展FragmentActive实现OnMapReadyCallback" 它的下划线为红色,表示要么声明我的类为“抽象”,要么实现一个抽象方法。 提示说我可以实现这个方法。这是什么意思?
当我只为一些特定的测试用例运行代码时,我得到了一个“由于超时错误而终止”。即使我的代码为其他测试用例成功编译。有人能帮我吗? 链接-https://www.hackerrank.com/challenges/phone-book 问题陈述: 你会得到一本电话簿,里面有人们的名字和电话号码。之后,你会得到一些人的名字作为查询。对于每个查询,打印该人的电话号码。 输入格式: 第一行有一个整数,表示通讯
我试图使java编译类文件,但它抛出了一个错误,如何修复它。
假设我们有以下三个类: 这将产生以下错误: 既然是整数,为什么它不选择类型?
我正在尝试使用命令,但收到的回报是错误: 而且我很确定数据库中并不存在该表,因为数据库完全是空的和干净的。 我使用的是PHP 7.3和MySQL 8.0.18社区版,它们都是在Windows Server 2019上由AMPPS运行的。我用的是Laravel 8