1

I have an existing table in which the primary key column is called gid instead of id. When I use a massive document query like the one below I get Error: column "id" does not exist. Can I specify that I have an id column named gid?

I am using the following to query the database:

db.reports.findDoc({ gid: gid }, function (err, res) {
   ...
});
Sergi Mansilla
  • 12,495
  • 10
  • 39
  • 48

1 Answers1

1

Massive's document tables assume a specific schema. If you need to store more information outside the document body, you may add columns to the document table and retrieve them with find or findOne; however, you cannot remove or rename columns without breaking the document table functionality. There is no way to specify that you are using an alternative document table schema. You're going to have to rename your gid column, or give up on using findDoc.

dmfay
  • 2,417
  • 1
  • 11
  • 22