小编sag*_*gar的帖子

如何在 MongoDB 中锁定集合

我的数据库中有一个集合

1.我想在用户更新文档时锁定我的收藏

2.没有完成期望读取的操作2.在更新其他用户的集合时,

请提供如何锁定 MongoDB 中集合的建议

此致

GSY

mongodb

4
推荐指数
1
解决办法
2万
查看次数

使用Specs2测试json数据

我添加了(在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)

json scala lift specs2

3
推荐指数
1
解决办法
2175
查看次数

标签 统计

json ×1

lift ×1

mongodb ×1

scala ×1

specs2 ×1