使用MongoDB查找散列数据

时间:2017-04-09 15:16:10

标签: mongodb hash

MongoDB是否可以通过哈希查找数据?

我正在尝试找到与此MySQL查询等效的MongoDB:

SELECT column FROM table WHERE SHA1(column) = "value"

1 个答案:

答案 0 :(得分:0)

It doesn't seems there is any such functionality (a bit old, but couldn't find in docs.mongodb.com either), but you can include a library that contains sha1 functionality (e.g. js-sha1) in mongo shell with load function, then use it within your mongo operation.