parameters: (_id)
return_statement: return r
docstring: The way in which Python manage dictionaries doesn't make easy to be sure
      of field ordering, which is important for MongoDB in the case of using an
      embedded document for _id. Thist function helps.
  
      :param _id: JSON document containing id, type and servicePath
      :return: a "flatten" version of the _id
docstring_summary: The way in which Python manage dictionaries doesn't make easy to be sure
      of field ordering, which is important for MongoDB in the case of using an
      embedded document for _id. Thist function helps.
docstring_tokens: The way in which Python manage dictionaries doesn t make easy to be sure of field ordering which is important for MongoDB in the case of using an embedded document for _id . Thist function helps .
function: def flatten(_id):
      """
      The way in which Python manage dictionaries doesn't make easy to be sure
      of field ordering, which is important for MongoDB in the case of using an
      embedded document for _id. Thist function helps.
  
      :param _id: JSON document containing id, type and servicePath
      :return: a "flatten" version of the _id
      """
  
      r = {'_id.id': _id['id']}
  
      if 'type' in _id:
         r['_id.type'] = _id['type']
      else:
         r['_id.type'] = {'$exists': False}
  
      if 'servicePath' in _id:
         r['_id.servicePath'] = _id['servicePath']
      else:
         r['_id.servicePath'] = {'$exists': False}
  
      return r
function_tokens: def flatten ( _id ) : r = { '_id.id' : _id [ 'id' ] } if 'type' in _id : r [ '_id.type' ] = _id [ 'type' ] else : r [ '_id.type' ] = { '$exists' : False } if 'servicePath' in _id : r [ '_id.servicePath' ] = _id [ 'servicePath' ] else : r [ '_id.servicePath' ] = { '$exists' : False } return r