anchor.diff:      client.CountAsync()
       |> Async.AwaitTask
   
  +let private countByDictionary selector props =
  +    let client = toClient props
  +
  +    client.CountBySelectorAsync selector
  +    |> Async.AwaitTask
  +
   /// Retrieves a count of all documents matching the given selector.
  -let countByMap (selector: Map<string, obj>) props =
  -    let client = toClient props
  -
  -    client.CountBySelectorAsync selector
  -    |> Async.AwaitTask
  +let countBySelector = convertMapToDict >> countByDictionary
   
   /// Retrieves a count of all documents matching the given selector.
   /// Usage: countByExpr<DocType> (<@ fun (c: DocType) -> c.SomeProp = SomeValue @>)
   /// NOTE: Davenport currently only supports simple 1 argument selectors.
  -let countByExpr (selector: Expr<('doctype -> bool)>) props =
  -    let client = toClient props
  -    let expr = toLinq selector
  -
  -    client.CountBySelectorAsync(expr)
  -    |> Async.AwaitTask
  -
  -/// Retrieves a count of all documents matching the given selector.
  -let countByMapExpr map props =
  -    let client = toClient props
  -    let selector = convertMapExpr map
  -
  -    client.CountBySelectorAsync(selector)
  -    |> Async.AwaitTask
  +let countByExpr<'doctype> = convertExprToMap<'doctype> >> countByDictionary
   
   /// Checks whether a document with the given id exists. If a revision is given, it will check whether that specific version exists.
   let exists id (rev: string option) props =
  
positive.code:     client.ListWithoutDocsAsync options
      |> Async.AwaitTask
  
  /// Searches for documents matching the given selector.
  let findByMap<'doctype> (selector: Map<string, obj>) (findOptions: FindOptions option) props =
      let client = toClient<'doctype> props
      let options = Option.toObj findOptions
  
      client.FindAsync(selector, options)
      |> Async.AwaitTask
      |> asyncMapSeq (fun doc -> Option.get doc.Data)
  
  /// Searches for documents matching the given selector.
  /// Usage: findByExpr<DocType> (<@ fun (c: DocType) -> c.SomeProp = SomeValue @>)
  /// NOTE: Davenport currently only supports simple 1 argument selectors.
  let findByExpr<'doctype> (selector: Expr<('doctype -> bool)>) (findOptions: FindOptions option) props =
      let client = toClient<'doctype> props
      let options = Option.toObj findOptions
      let expr = toLinq selector
  
      client.FindAsync(expr, options)
      |> Async.AwaitTask
      |> asyncMapSeq (fun doc -> Option.get doc.Data)
  
  /// Searches for documents matching the given selector.
  let findByMapExpr<'doctype> map (findOptions: FindOptions option) props =
      let client = toClient<'doctype> props
      let options = Option.toObj findOptions
      let selector = convertMapExpr map
  
      client.FindAsync(selector, options)
      |> Async.AwaitTask
      |> asyncMapSeq (fun doc -> Option.get doc.Data)
  
  /// Returns a count of all documents, *including design documents*.
  let count props =
  
negative.code:     client.ExistsAsync(id, Option.toObj rev)
      |> Async.AwaitTask
  
  let private existsByDictionary selector props =
      let client = toClient props
  
      client.ExistsBySelectorAsync selector
      |> Async.AwaitTask
  
  /// Checks that a document matching the given selector exists.
  let existsBySelector = convertMapToDict >> existsByDictionary
  
  /// Checks that a document matching the given selector exists.
  /// Usage: existsByExpr<DocType> (<@ fun (c: DocType) -> c.SomeProp = SomeValue @>)
  /// NOTE: Davenport currently only supports simple 1 argument selectors.
  let existsByExpr<'doctype> = convertExprToMap<'doctype> >> existsByDictionary
  