Skip to content

Commit

Permalink
Sanitized sock search with from MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
IGuy37 committed Jul 8, 2024
1 parent 2ef19f5 commit 0af31f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ app.post('/socks/search', async (req, res) => {
const collection = db.collection(collectionName);
console.log(req.body);
const searchTerm = req.body.searchTerm;
const documents = await collection.find({"sockDetails.color": searchTerm}).toArray();
const documents = await collection.find({"sockDetails.color": {$eq: searchTerm}}).toArray();
console.log(documents);
client.close();
res.json(documents);
Expand Down

0 comments on commit 0af31f4

Please sign in to comment.