Sha256: def26aeb15a32022a7a4f58031c309a99a92fa314c5e7c692369e5dcfe29ebaf

Contents?: true

Size: 311 Bytes

Versions: 2

Compression:

Stored size: 311 Bytes

Contents

module Mongo

  class MongoClient
    def is_replicaset?
      begin
        cmd = BSON::OrderedHash.new
        cmd["replSetGetStatus"] = 1
        result = self.db("admin").command(cmd)
        return !result["set"].blank?
      rescue Mongo::OperationFailure
        return false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongodb-graphite-agent-0.1.1 lib/mongodb/graphite/agent/mongo_cient_extensions.rb
mongodb-graphite-agent-0.1.0 lib/mongodb/graphite/agent/mongo_cient_extensions.rb