rename ElemType to PathSegmentsType
convert request to mongodb query