Update db.js

add cross-environment example