草庐IT

already_inserted

全部标签

Git报错Updates were rejected because the tag already exists in the remote.解决方案

情景    在使用git推送的时候,不知道是什么原因导致报错了,内容为:Updateswererejectedbecausethetagalreadyexistsintheremote.这里有两种解决方案,有种能彻底解决问题。No.1:Pushalltags推送的时候,将这个选项取消 这是使用SourceTree视图进行推送的,如果是命令端,就不要使用--tagsNo.2:将本地的Tags先删除(谨慎操作可先备份,再删除),然后再Pull拉一下,再Push就OK了,彻底解决问题 文件路径在项目所在路径【.git/refs/tags】。

mongodb - MongoDB 中的 "Find() inside Insert"?

亲们,我有一个名为“动物”的集合,示例文档-{"_id":ObjectId("57321290c46ff86ce9e00b35"),"parent_id":null,"author":"xxx@hotmail.com","name":"Mammal","status":"active","sub_species":["Dog","Cat","Cow"]}{"_id":ObjectId("57321c10c46ff86ce9e00b36"),"author":"xxx@hotmail.com","name":"Dog","status":"active","parent_id":"573

mongodb - monogdb "errmsg"中的错误:“WiredTigerIndex::insert:键太大无法索引,失败

我在mongo中创建索引:db.table.createIndex({"chr":1,"Start":1,"End":1,"Ref":1,"Alt":1})运行一段时间后报错:errorinmonogdb"errmsg":"WiredTigerIndex::insert:keytoolargetoindex,failing如何修复此错误? 最佳答案 在MongoDB中,从2.6开始,一个索引条目的总大小必须小于1024字节。Documentationhere换句话说,至少有一份文档在您尝试索引的字段之一中具有较大的值(value)。

mongodb - monorestore 问题 BadValue : object to insert exceeds cappedMaxSize

我将Meteor与WireTiger3.2.12一起使用我使用monogdump制作了转储当我尝试恢复它时,在一些文件上我收到了这个:error:writetooplogfailed:BadValue:objecttoinsertexceedscappedMaxSize这个集合不是“上限”(我用db.my_collection_name.stats()["capped"]测试了它)如何导入此类文件?提前致谢 最佳答案 这可能是因为该集合之前是作为上限创建的,并且它仍然具有附加到它的属性。检查集合属性,或者(如果不需要数据,将其删除并

java - MongoDB-Java 驱动程序 : Catch exception when insert fails

我正在做一个像这样的非常基本的插入:try{DBmongoDb=_mongo.getDB(_databaseName);DBCollectioncollection=mongoDb.getCollection(_collectionName);collection.insert(myBasicDBObject);}catch(IOExceptionex){//Unreachablecode}catch(MongoExceptionex){//Exceptionneverthrown}catch(Exceptionex){//Handleexception}假设由于某种原因_databa

javascript - Node JS : Not inserting into mongodb

所以我在tutsplus.com上学习了Node.js教程类(class),到目前为止它一直很棒。我正在学习有关MongoDB的类(class),但我有点不知所措。我不确定为什么这对我不起作用,因为它在视频中有效并且我的代码是相同的。我能想到的是自一年前制作类(class)以来已经有了更新。从在不同点尝试console.log我认为数据在开始时没有正确插入,因此没有返回任何内容。除cursor.toArray()的回调外,一切似乎都按预期触发。我目前正在学习node和mongodb,所以如果我犯了一个明显的错误,请多多包涵。我被指示编写以下文件,然后在命令行中执行它。编辑:我已将问题缩

javascript - Mongodb/mongoose insert 不是函数

我的插入不工作,我得到错误错误:Token.insertisnotafunctionvarToken=module.exports=mongoose.model('tokens',tokenSchema);//errormodule.exports.saveToken=function(owner_id,token,callback){console.log(owner_id,token);Token.insert({"owner":owner_id,"token":token},callback);}//workingmodule.exports.getAllTokens=funct

node.js - Node js,mongodb : check if an object already exist

我是nodejs和mongodb的新手,所以如何检查集合中是否已经存在对象,请注意我在模式中的字段类型是对象或JSONconstBillSchema=mongoose.Schema({content:{type:Object//orJSON},});constBill=module.exports=mongoose.model('Bill',BillSchema);module.exports.addBill=function(newBill,callback){//Checkforallbilltitlesandcontent,ifnewBilldoesn'texistthenadd

mongodb - ensureIndex({field :1}) when an index already exists?

我希望始终确保我的收藏被编入索引,并且我半定期地添加和删除它们。假设我在每次Web请求时都与数据库建立新连接,每次连接时执行一些db.collection.ensureIndex({field:true})语句是否可以? 最佳答案 据我所知,MongoDB只会简单地查询系统集合以查看索引是否存在,然后再创建它......http://www.mongodb.org/display/DOCS/Indexes#Indexes-AdditionalNotesonIndexes>db.system.indexes.find();您可以运行g

mongodb - 皮蒙戈 : insert_many + unique index

我想在我的集合中insert_many()文件。其中一些可能与集合中的现有文档具有相同的键/值对(在我的示例中为screen_name)。我在此键上设置了唯一索引,因此出现错误。my_collection.create_index("screen_name",unique=True)my_collection.insert_one({"screen_name":"user1","foobar":"lalala"})#noproblemto_insert=[{"screen_name":"user1","foobar":"foo"},{"screen_name":"user2","foo