Add database to default collection window template

zcoss shared this idea 5 years ago

It would be great to be able to include the database in the Modify Default Code options to prevent mixups when performing operations. We have many databases on a single connection and sometimes have the issue where either:

  1. Accidentally perform a create operation on the active database, instead of the one we meant to.
  2. Accidentally perform an unsuccessful query on the active database, instead of the one we meant to.

For instance: db.getSiblingDB(%%database%%).%%collection%%.find({$1})

It would also be great to have an option in the lookahead feature where it would pre-fill the database instead of moving the cursor to inside the parenthesis when typing db.getSiblingDB into the shell.

Replies (3)


We have worked out new build(4.7.4) to add %%database%% to code template. Please download and give it a try.


I also noticed that you added the lookahead for databases into db.getSiblingDB() from the shell! Thanks so much!


This also works perfectly for the default template. This is what I'm using:

Thanks again!

Leave a Comment
Attach a file