fixed context determination for MongoDataSource
added type parsing for resourceId
fixed setting of collection $parent