pharo-nosql / mongotalk

A Pharo driver for MongoDB
MIT License
19 stars 13 forks source link

Unify dictionary construction for commands? #61

Open tinchodias opened 5 years ago

tinchodias commented 5 years ago

These are some ways the dictionaries that will be transformed into json are created:

    self command: (OrderedDictionary new at: #ismaster put: 1; yourself).

    command := OrderedIdentityDictionary new
        at: #create put: aString;
        yourself.

    dict := {
        'insert'->collectionName.
        'documents'->{newDictionary}.
        } as: OrderedDictionary.

I see it's justified to use an ordered dictionary for commands: e.g., it's wrong to execute the command with a json that has 'document' before 'insert'. But I don't see a reason to use the Identity one.

I create this issue because of a small discussion in issue #60.