Expose `idType` in memory engine
Without this, the API between memory-backed services have a
different API to save-mongodb services, which can cause test
failures.
What cases do you still need idType()?
article-slug-listener performs a read on the service by firstly casting the _id. This works with a save-mongodb persistence, but not a memory engine.
I don't think it is needed in that case.
I was hoping to deprecate idType() but I'm unsure if there are still any valid use-cases
The tests do appear to pass without the call to service.idType(). Maybe it isn't needed...
It looks as though castIdProperty is called on read which caters for that case: https://github.com/serby/save-mongodb/blob/master/lib/mongodb-engine.js#L95
The only other use case I can think is:
var ids = _.map([1, 2, 3], function (id) {
return service.idType(id)
})
var query = { _id: { $in: ids } }
Would this be catered for?
I think so. https://github.com/serby/save-mongodb/blob/master/lib/mongodb-engine.js#L71
In which case, i dont think this is needed and idType() can be removed from save-mongodb as well.