Salat author here. Ghik is correct: your problem is that you are wrapping your model objects in a spurious MongoDBList
. Also, you appear to be feeding model objects directly to your collection. If you're going to do that, you need to manually serialize each object before inserting it.
I would recommend this approach is unnecessary! Here's what you need to do. Get either SalatDAO
or ModelCompanion
working - see https://github.com/novus/salat/wiki/SalatDAO and https://github.com/novus/salat/wiki/SalatWithPlay2.
Here's a sample implementation of SalatDAO
for a model object called MyObject
:
object MyObjectDAO extends SalatDAO[MyObject, ObjectId](collection = MongoConnection()("my_test_db")("my_test_coll"))
Then just insert your docs using SalatDAO#insert(docs: Traversable[ObjectType], wc: WriteConcern = defaultWriteConcern)
MyObjectDAO.insert(docs)