See semantic versioning. Please note point 4. on that page: Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
Sometimes it is good not to work all the time on the same project. Now returning to have a glimpse at it, I saw that it is completely unnecessary to handle the read and write concern data anywhere in the program because the user (him/her)self must insert this information in the request. I had already made some attempt to set and use a readconcern. Now, the read concern (and maybe some experimental write concern) will be completely removed from the driver and leaving it up to the user.
An example where both are used;
my MongoDB::Client $client .= new(:uri<mongodb://>);
my MongoDB::Database $db = $!client.database('UserProfile');
given my BSON::Document $request .= new {
.<find> = $collection;
.<filter> = BSON::Document.new: (departement => 'administration');
.<limit> = $limit if ?$limit;
.<readConcern> = BSON::Document.new: (level => 'local',);
}
my BSON::Document $doc = $db.run-command($request);
if $doc<ok> {
…
# After a modification update the data from $new-data
given $request .= new {
.<update> = $collection;
.<updates> = [
BSON::Document.new: (
:q(BSON::Document.new: (departement => 'administration'),
:u($new-data),
),
],
:writeConcern(BSON::Document.new: (:w<majority>)
}
}
See also find, update, read concern and write concern in the Mongodb documentation.
A start is made to update the pod documents and to merge them into the modules and are regenerated. Many docs were out of sync with the changes made. The documentation will become available here.
Made sure that all tests in xt/Basic work again. These are extra tests meant to run on Travis and Appveyor.
.uri-unescape()
in $uri-actions
in MongoDB::Uri.connectTimeoutMS
and socketTimeoutMS
from the mongodb design documents and URI specification.set-filter()
, reset-filter()
and clear-filter()
to MongoDB::Log. It filters lines from the log on the module name. This is helpful when tracing is used and too many output is generated. However, it will not filter when the message level is a warning, error or fatal. Warnings and errors can be suppressed of all message by using modify-send-to()
or add-send-to()
.Build.pm6
, all of the shell script is moved into the build module. This saves us some nasty shell quirks.--show
option to get user info.--del
option to delete user account.
--add
option.
.find-key(Int)
was removed but referred from Database module to get current command sent to server. Changed into .keys[0]
which does the same. Remember that keys keep same order!.check()
in Socket should also test for is-open when timeout wasn’t yet exceeded.
name
returns the servername including the brackets when ipv6 address. Submethod BUILD
is changed to handle the brackets around an ipv6 address.BUILD
now retries after a connect failure with the PF_INET6
family option. These tests are rather quick when the servers are close. So ipv4 is tested first, then ipv6. In the future this might change in sequence or tried in parallel.Auth::SCRAM implemented. No username/password normalization yet.
for $collection.find() -> BSON::Document $doc {...}
instead of
my MongoDB::Cursor $cursor = $collection.find();
while $cursor.fetch -> BSON::Document $doc {...}
The last method will stay possible to do
$client.database('name')
. Back then it was a Connection instead of Client. The reason that I have chosen to change it is because of the way read concerns should be processed. It could work with a replicaset or sharded systems but not with a mix of these. Now a uri can be provided to a client with some hosts and the Client will create several Server objects which will monitor the mongo server and find all the other servers in a replica set. Then a second Client can used with am other server independent of the first set of servers. Now the idea is that a read concern can be set at the Client, Database or Collection creation or even at the individual command run-command() and find().t/400-run-command.t
and therefore becomes a good example file. Next a list of methods removed.
@*INC
is gone, use lib
is the way. A lot of changes done by zoffixznet.MongoDB
. Originally there are use statements to load other modules in. Modules are changed later in such a way that modules needed to be loaded in other modules as well and then it will be some overhead of loading the modules twice or more. So I want to clean these statements from the module. Now the user can decide for himself what he needs. Not all modules are always needed and some are loaded by others. E.g. MongoDB::Document::Users
is needed only to add or remove accounts. Furthermore when a connection is made using MongoDB::Connection
, MongoDB::Database
will be available because it needs to create a database for you. Because MongoDB::Database
is then loaded, MongoDB::Collection
is then loaded too because a database must be able to create a collection._id
is checked if the value is unique in te collection.m/^ <[\$ _ A..Z a..z]> <[.\w _]>+ $/
. Note the $
, It is accepted because the collection $cmd
is sometimes used to get information from. The method .create_collection()
will also check the collection name but will not accept the $
.