Mongo return no document in result

hello guys,
here when I try login with this method:
https://play.golang.org/p/Sv5ZULBZMzL

got this error message :
http: panic serving 127.0.0.1:56486: mongo: no documents in result

and as you can see I placed some logs. but we haven’t any log in output
(I build go file and place it beside template files)

may please guide me how fix this . thank you

This error is documented here. There are apparently no records in the database.ADMIN_COLLECTION matching {"phone": phone, "password": password}.

I recommend logging out your database.ADMIN_COLLECTION, phone and password values and then querying your MongoDB database yourself to see if you can find matching values.

I don’t know if you’re doing this or not, but I want to advise against storing passwords in plain text in a database. I hope that your password parameter is encrypted and/or hashed and salted, etc…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.