lundi 17 août 2020

Spring Data Mongo DB: Usage of Update and Query in Service classes

I am new to using MongoDb and haven't seen any production code using Spring Data MongoDb.

My question is, Is it good idea to use MongoDb Update, Query and Aggeregation objects in Service classes and later call template or repository methods from this instantiated objects ?

If don't use like this, how can cleanly pass all the fields which are going to be updated [nested, arrayfields] from services classes to repository classes ? [my main document has around 600 fields and updates generally have lesser fields than this]

And If I use this Objects(Update, Query and Aggeregation) in Service classes, is'nt layer separation going to be impacted ?

Aucun commentaire:

Enregistrer un commentaire