Error when getting documents using the _id field
Closed this issue · 1 comments
Hi team,
I'm getting an error when I'm querying for a specific record by _id
var business = controller.storage.businesses.get(
user.businessId
,
function (error, business) {
...
});
Where inside user.businessId it is stored the _id of the user that created that specific business.
When executing, I get the following error:
Error: Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
and according to the stack overflow topics I found _id should be fine containing any data (it's a little bit tricky since none of them is specific to botkit storage). Could you help? Is there any additional process I need to do to the _id field to be able to find those records?
Thanks!
Never mind, I found the issue! :D
It looks the way I was saving _id wasn't the standard format expected by Mongo and Botkit, not a botkit issue
Thank you anyway!