title: MongoDB: Which would be faster? Regex search on string or direct search on array?
body: <p>My application currently performs a regex search on a text field which is a comma separated Objectids. According to <a href="https://docs.mongodb.org/manual/reference/operator/query/regex/#index-use" rel="nofollow">Mongodb documentation</a>, Mongo uses indexes while doing regex searches. </p>
  
  <p>My initial thought was to use an array to store the ObjectIds instead of using the string. But will the array search have better performance than the regex search since both are using indexes? </p>