How i can create a View with multi Id ? (CouchBase Lite for Android)


#1

I have a question with CouchBase Lite for Android, i hope everyone can help me. Thank you
I want to create a View of a Database for do the query. But each Object in each Document, I have many Ids
For example:
House {id:idhouse , Gate {id:idgate, …}, Room {id: idroom,…},…}.
So, I want to create a View , it can include all Ids of the House, Gate and Room. because, with it, i can easy find House with Id of the Gate or Id of the Room.
But, i don’t know what is the best solution. Can you help me?
Thank you .
@jamiltz , @ingenthr


#2

Hi @huuviet_nguyen,

Followings are just idea.
Idea 1: You can create multiple views. View for House, View for Gate, View for room, …
Idea 2: Generates key with {object_type}_{id} in map() function.

Thanks,