mongodb. how map strings to integers from another collection
I have collection with documents, for example: [ { 'id':'1' 'some_field':'test', 'rates':[ {'user_id':'12','rate':'very_good'}, {'user_id':'13','rate':'very_good'} {'user_id':'14','rate':'bad'}, {'user_id':'15','rate':'normal'} ] } ] And i have collection with values of rates in string: [ { "rate_name" : "bad", "rate_value" : 1 }, { "rate_name"…