Open syzer opened 9 years ago
Parasite.get(req.params.id...)
:) +1 ready to close so i can get
Parasite.findById = Parasite.get
One more question: I was trying to get general method to get primary key name of Parasite:
Parasite.keys[0]
or is there any general method, like
getUUID()
?
If I understand correctly, you want to get the primary key column name. In which case, I think you should just be using id
for the id field---it's much more predictable.
In a perfect world.... but I do not own the Db. Cannot use id
as key name. I used keys[0].. since i could not find API method for it.
You can always just set keys[0] to whatever you want. Use Object.defineProperty if you're going to do it though!
Right now i'm running query like this:
But model Parasite has already defined That
ParasiteID
is its primary key so i would like to run such a query by:that would allow abstracting away process of creating controllers