我的数据库中有一个集合
1.我想在用户更新文档时锁定我的收藏
2.没有完成期望读取的操作2.在更新其他用户的集合时,
请提供如何锁定 MongoDB 中集合的建议
此致
GSY
我添加了(在built.sbt中)matcher-extra: -
"org.specs2" %% "specs2" % "2.3.4" % "test",
"org.specs2" % "specs2-matcher-extra_2.10" % "2.3-scalaz-7.1.0-M3",
Run Code Online (Sandbox Code Playgroud)
("/"符号未解析)
我对Json的示例测试用例如下所示: -
package specs.model
import org.specs2.mutable.Specification
import org.specs2.matcher.JsonMatchers
class Json extends Specification with JsonMatchers {
"Json Matcher" should {
"1st field" in {
val json = """{"name":"sagar"}"""
json must /("name" -> "sagar")
}
"2nd field" in {
val json = """{"id":1}"""
json must /("id" -> 1.0)
}
}
}
Run Code Online (Sandbox Code Playgroud)
ERRORMSG: -
[info] Compiling 2 Scala sources to \target\scala- 2.10\test-classes...
[info] Json
[info]
[info] Json Matcher …Run Code Online (Sandbox Code Playgroud)