anchor.diff:    ]),
   
     %test match and sort
  -  {true, {result, Res}} = mongo:command(Connection, {aggregate, <<"test">>, pipeline, [{'$match', {key, <<"test">>}}, {'$sort', {tag, 1}}]}),
  -  ?debugFmt("Got ~p", [Res]),
  -  [
  -    {'_id', _, key, <<"test">>, value, <<"one">>, tag, 1},
  -    {'_id', _, key, <<"test">>, value, <<"two">>, tag, 2},
  -    {'_id', _, key, <<"test">>, value, <<"three">>, tag, 3},
  -    {'_id', _, key, <<"test">>, value, <<"four">>, tag, 4}
  -  ] = Res,
  +  {true, {result, Res}} = mongo:command(Connection, {aggregate, Collection, pipeline, [{'$match', {key, <<"test">>}}, {'$sort', {tag, 1}}]}),
  +  ct:log("Got ~p", [Res]),
  +
  +  true = is_equal_lists_of_bsons(
  +           [
  +            {key, <<"test">>, value, <<"one">>, tag, 1},
  +            {key, <<"test">>, value, <<"two">>, tag, 2},
  +            {key, <<"test">>, value, <<"three">>, tag, 3},
  +            {key, <<"test">>, value, <<"four">>, tag, 4}
  +           ],
  +           Res),
   
     %test match & sort with limit
     {true, {result, Res1}} = mongo:command(Connection,
  -    {aggregate, <<"test">>, pipeline,
  +    {aggregate, Collection, pipeline,
         [
           {'$match', {key, <<"test">>}},
           {'$sort', {tag, 1}},
           {'$limit', 1}
         ]}),
  -  ?debugFmt("Got ~p", [Res1]),
  -  [
  -    {'_id', _, key, <<"test">>, value, <<"one">>, tag, 1}
  -  ] = Res1,
  +  ct:log("Got ~p", [Res1]),
  +  true = is_equal_lists_of_bsons(
  +           [
  +            {key, <<"test">>, value, <<"one">>, tag, 1}
  +           ],
  +           Res1),
     Config.
   
   update(Config) ->
  
positive.code:     'ratings.0.rating', 2
    }},
    mongo:update(Connection, Collection, {'_id', 100}, Command3),
    Res4 = find(Connection, Collection, {'_id', 100}),
    ?debugFmt("Got ~p", [Res1]),
    [{'_id', 100,
      sku, <<"abc123">>,
      quantity, 500,
      instock, true,
      reorder, false,
      details, {model, "14Q3", make, "zzz"},
      tags, ["coats", "rain gear", "clothing"],
      ratings, [{by, "ijk", rating, 2}],
      expired, true}
    ] = Res4,
  
    Config.
  
  
  
negative.code: 
    %check data inserted
    Res = find(Connection, Collection, {'_id', 100}),
    ct:log("Got ~p", [Res]),
    [{'_id', 100,
      sku, <<"abc123">>,
      quantity, 250,
  