I am performing joins in mongodb using $lookup, now i am facing a problem here. I have two collections first one to contains users all bookmarks brands and the second one co
You cannot convert the string to a object Id within the pipeline, you'll have to go though each document and convert it manually, using something like (you shouldnt be storing a mix match of types anyway, so it's probably worth updating in the long run):
how to convert string to numerical values in mongodb
as for does $lookup use index, If you look at the stats from this blog you'll see that indexes are used -
http://guyharrison.squarespace.com/blog/2016/7/4/join-performance-in-mongodb-32-using-lookup.html