code: func (vdb *versionedDB) GetStateRangeScanIteratorWithMetadata(namespace string, startKey string, endKey string, metadata map[string]interface{}) (statedb.QueryResultsIterator, error) {
  
  	requestedLimit := int32(0)
  	// if metadata is provided, validate and apply options
  	if metadata != nil {
  		//validate the metadata
  		err := statedb.ValidateRangeMetadata(metadata)
  		if err != nil {
  			return nil, err
  		}
  		if limitOption, ok := metadata[optionLimit]; ok {
  			requestedLimit = limitOption.(int32)
  		}
  	}
  
  	// Note:  metadata is not used for the goleveldb implementation of the range query
  	compositeStartKey := constructCompositeKey(namespace, startKey)
  	compositeEndKey := constructCompositeKey(namespace, endKey)
  	if endKey == "" {
  		compositeEndKey[len(compositeEndKey)-1] = lastKeyIndicator
  	}
  	dbItr := vdb.db.GetIterator(compositeStartKey, compositeEndKey)
  
  	return newKVScanner(namespace, dbItr, requestedLimit), nil
  
  }
docs: // GetStateRangeScanIteratorWithMetadata implements method in VersionedDB interface