Update db.js

allow aggregation framework