db.books.update({bookId:"123461"},{$set:{"bookPrice":"6.23"}})
Run Code Online (Sandbox Code Playgroud)
我收到错误:
update { q: { bookId: "123461" }, u: { $set: { bookPrice: "6.23" } }, multi: false, upsert: false } does not contain _id or shard key for pattern { _id: "hashed" }
Run Code Online (Sandbox Code Playgroud)
但是当我在下面使用时它起作用.
db.books.update({_id:ObjectId("54b88167498ec382221a82c2")},{$set: {"bookPrice":"6.23"}})
Run Code Online (Sandbox Code Playgroud)
为什么它不适用于bookId
我正在使用连接到mongo db的spring boot web应用程序,它正在开箱即用.我只使用以下属性:
spring.data.mongodb.host=myHost
spring.data.mongodb.port=27017
spring.data.mongodb.database=myDatabase
spring.data.mongo.repositories.enabled=true
spring.data.mongodb.username=myUser
spring.data.mongodb.password=myPassword
Run Code Online (Sandbox Code Playgroud)
MongoDB的默认超时是10秒.我想配置超时.我试过做
spring.data.mongodb.socketTimeout=2或 spring.data.mongodb.connectionTimeout=2
这些属性都不起作用.这是我可以在属性中指定的东西,Spring框架会处理它,或者有人可以举例说明通过声明Bean来实现它.
我想从 UITextView 获取用户输入的最新单词。
用户可以在 UITextView 的任何位置输入一个单词,在中间、结尾或开头。当用户完成输入并按下一个空格并使用“来自”的建议进行任何更正时,我会将其视为一个词UIMenuController。
示例:用户在UITextView文本中间的某处输入“kimd” ,他会弹出一个自动更正“kind”的弹出窗口。在他这样做之后,我想捕获“种类”并在我的应用程序中使用它。
我在互联网上搜索了很多,但找到了讨论用户最终输入文本时的解决方案。我还尝试检测一个空格,然后进行向后搜索,直到找到某个文本后的另一个空格,以便我可以将其定义为一个单词。但我认为可能有更好的方法来做到这一点。
我在某处读到 iOS 缓存了我们在文本字段或文本视图中输入的最近文本。如果我能从顶部弹出,那就是我想要的。我只需要处理那个对象。
我真的很感激你的帮助。
注意:用户可以在 UItextview 的任何位置输入文本。我需要最近输入的词
谢谢。
我正在使用Xcode 5的故事板来创建一个应用程序iOS SDK 7.0.
我拖了一个按钮到视图.我希望我的按钮默认显示"A".以下是按钮属性:类型:系统,状态配置:默认,标题:普通
我希望我的按钮在选定状态下显示"B".因此,更改的按钮属性:State Config:Selected
在Button的属性检查器中,在Control下,有一个名为Selected的属性.如果我选中选中,而不是显示"B",它只是像A上的标记一样突出显示,即没有看到任何字符.
I ran it in XCODE. WHen the button is not selected "A" is displayed as expected but when I select the button, instead of displaying B, the text portion of the button is highlighted with light blue color. Also, I never selected the Highlighted Content under the Control.
How can this be resolved, so that I can display the state correctly?
ios ×2
mongodb ×2
objective-c ×2
iphone ×1
spring ×1
spring-boot ×1
uibutton ×1
uitextview ×1
xcode ×1