Adding swarm query support for BDB