In Couchbase Lite, is this permissible/encouraged or will it cause race conditions / any other problems?
let view = database.viewNamed("myView")
view.setMapBlock({ properties, emit in
database.existingDocument(withID: properties["some_foreign_key"])
Basically i'm trying to create a view which is the equivalent of an SQL 'left inner join'.
It is not permitted. Map functions must be pure, as in given the same set of inputs they will always produce the same outputs. No external state may be referenced.