Implemented query for collections in memory store