I am facing the exact same issue that is described here. I have user_creds
endpoint for my API. When I visit localhost:5000/user_creds/
, I can see all the documents in that collection. But when I do something like localhost:5000/user_creds/someemail@gmail.com
, I always get a 404 Not Found response.
user_creds
domain in settings.py looks like this:
'user_creds': {
'schema': {
'email': {
'type': 'string',
'regex': r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)",
'required': True,
'unique': True,
},
'password': {
'type': 'string',
'required': True
},
}
'resource_methods': ['GET', 'POST'],
'item_methods': ['GET', 'PATCH', 'PUT'],
'additional_lookup': {
'url': 'regex("^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$")',
'field': 'email'
}
}
I am following the example given here but cant figure out where I am going wrong. Also, if I visit this URL: http://127.0.0.1:5000/user_creds?email==%22abcd12@gmail.com%22
, I get all the documents in the collection instead of getting just a single document which matches the email regex. If I visit this http://127.0.0.1:5000/user_creds?where=email==%22abcd12@gmail.com%22
, I am getting the desired response.