collection.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:mongodb-monitoring 作者: jruaux 项目源码 文件源码
def _command(self, sock_info, command, slave_ok=False,
                 read_preference=None,
                 codec_options=None, check=True, allowable_errors=None,
                 read_concern=DEFAULT_READ_CONCERN):
        """Internal command helper.

        :Parameters:
          - `sock_info` - A SocketInfo instance.
          - `command` - The command itself, as a SON instance.
          - `slave_ok`: whether to set the SlaveOkay wire protocol bit.
          - `codec_options` (optional) - An instance of
            :class:`~bson.codec_options.CodecOptions`.
          - `check`: raise OperationFailure if there are errors
          - `allowable_errors`: errors to ignore if `check` is True
          - `read_concern` (optional) - An instance of
            :class:`~pymongo.read_concern.ReadConcern`.

        :Returns:

            # todo: don't return address

          (result document, address of server the command was run on)
        """
        return sock_info.command(self.__database.name,
                                 command,
                                 slave_ok,
                                 read_preference or self.read_preference,
                                 codec_options or self.codec_options,
                                 check,
                                 allowable_errors,
                                 read_concern=read_concern)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号