implementing collection query on in memory store