5

My tests running in BitBucket pipeline 'suddenly' started to fail with this error: unrecognised field 'snapshot' (code = 9).

Locally the test all run fine though. Both locally and in BitBucket I'm using a Mongo 3.7 docker container. Reactive Mongo version is 0.13.0

Anyone have an idea why this happens and how to fix this?

Joost den Boer
  • 4,556
  • 4
  • 25
  • 39

2 Answers2

5

Finally found the problem. Apparently I want not running Mongo 3.7 locally, but an older version.

The latest ReactiveMongo version (0.13.0) is not compatible with Mongo > 3.4. The 'snapshot' field thing apparently was introduced in Mongo 3.7. Even though while not supported officially, Mongo 3.6 did work.

So solution was to downgrade the Mongodb version to 3.6 (or lower)

Joost den Boer
  • 4,556
  • 4
  • 25
  • 39
0

Continuing Joost de Boer answer, using version 0.16.0 it's working for me:

libraryDependencies += "org.reactivemongo" %% "play2-reactivemongo" % "0.16.0-play26"

Even though I'm using play framework I'm pretty sure it is fixed in 0.16.0 driver level

nbtk
  • 3,039
  • 4
  • 21
  • 19