minor: removed entraneous constant
This commit is contained in:
parent
d39169530a
commit
992f6c30dc
|
@ -14,11 +14,9 @@ begin
|
|||
raise LoadError if CBson::VERSION != Mongo::VERSION
|
||||
require 'mongo/util/bson_c'
|
||||
BSON = BSON_C
|
||||
BSON_SERIALIZER = CBson
|
||||
rescue LoadError
|
||||
require 'mongo/util/bson_ruby'
|
||||
BSON = BSON_RUBY
|
||||
BSON_SERIALIZER = BSON
|
||||
warn "\n**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance."
|
||||
warn " You can install the extension as follows:\n gem install mongo_ext\n"
|
||||
warn " If you continue to receive this message after installing, make sure that the"
|
||||
|
|
|
@ -218,7 +218,7 @@ module Mongo
|
|||
message.put_int(0)
|
||||
BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{@name}")
|
||||
message.put_int(0)
|
||||
message.put_array(BSON_SERIALIZER.serialize(selector, false).unpack("C*"))
|
||||
message.put_array(BSON.serialize(selector, false).unpack("C*"))
|
||||
@connection.send_message(Mongo::Constants::OP_DELETE, message,
|
||||
"db.#{@db.name}.remove(#{selector.inspect})")
|
||||
end
|
||||
|
@ -248,8 +248,8 @@ module Mongo
|
|||
update_options += 1 if options[:upsert]
|
||||
update_options += 2 if options[:multi]
|
||||
message.put_int(update_options)
|
||||
message.put_array(BSON_SERIALIZER.serialize(selector, false).unpack("C*"))
|
||||
message.put_array(BSON_SERIALIZER.serialize(document, false).unpack("C*"))
|
||||
message.put_array(BSON.serialize(selector, false).unpack("C*"))
|
||||
message.put_array(BSON.serialize(document, false).unpack("C*"))
|
||||
if options[:safe]
|
||||
@connection.send_message_with_safe_check(Mongo::Constants::OP_UPDATE, message, @db.name,
|
||||
"db.#{@name}.update(#{selector.inspect}, #{document.inspect})")
|
||||
|
@ -508,7 +508,7 @@ EOS
|
|||
message = ByteBuffer.new
|
||||
message.put_int(0)
|
||||
BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{collection_name}")
|
||||
documents.each { |doc| message.put_array(BSON_SERIALIZER.serialize(doc, check_keys).unpack("C*")) }
|
||||
documents.each { |doc| message.put_array(BSON.serialize(doc, check_keys).unpack("C*")) }
|
||||
if safe
|
||||
@connection.send_message_with_safe_check(Mongo::Constants::OP_INSERT, message, @db.name,
|
||||
"db.#{collection_name}.insert(#{documents.inspect})")
|
||||
|
|
|
@ -470,7 +470,7 @@ module Mongo
|
|||
BSON_RUBY.serialize_cstr(message, "#{db_name}.$cmd")
|
||||
message.put_int(0)
|
||||
message.put_int(-1)
|
||||
message.put_array(BSON_SERIALIZER.serialize({:getlasterror => 1}, false).unpack("C*"))
|
||||
message.put_array(BSON.serialize({:getlasterror => 1}, false).unpack("C*"))
|
||||
add_message_headers(Mongo::Constants::OP_QUERY, message)
|
||||
end
|
||||
|
||||
|
|
|
@ -324,8 +324,8 @@ module Mongo
|
|||
if query_contains_special_fields?
|
||||
selector = selector_with_special_query_fields
|
||||
end
|
||||
message.put_array(BSON_SERIALIZER.serialize(selector, false).unpack("C*"))
|
||||
message.put_array(BSON_SERIALIZER.serialize(@fields, false).unpack("C*")) if @fields
|
||||
message.put_array(BSON.serialize(selector, false).unpack("C*"))
|
||||
message.put_array(BSON.serialize(@fields, false).unpack("C*")) if @fields
|
||||
message
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue