/// <summary>
        /// Value list range example.
        /// </summary>
        private void RunListRangeExample(AerospikeClient client, Arguments args)
        {
            Key    key     = new Key(args.ns, args.set, "mapkey");
            string binName = args.GetBinName("mapbin");

            // Delete record if it already exists.
            client.Delete(args.writePolicy, key);

            List <Value> l1 = new List <Value>();

            l1.Add(MillisSinceEpoch(new DateTime(2018, 1, 1)));
            l1.Add(Value.Get(1));

            List <Value> l2 = new List <Value>();

            l2.Add(MillisSinceEpoch(new DateTime(2018, 1, 2)));
            l2.Add(Value.Get(2));

            List <Value> l3 = new List <Value>();

            l3.Add(MillisSinceEpoch(new DateTime(2018, 2, 1)));
            l3.Add(Value.Get(3));

            List <Value> l4 = new List <Value>();

            l4.Add(MillisSinceEpoch(new DateTime(2018, 2, 2)));
            l4.Add(Value.Get(4));

            List <Value> l5 = new List <Value>();

            l5.Add(MillisSinceEpoch(new DateTime(2018, 2, 5)));
            l5.Add(Value.Get(5));

            IDictionary inputMap = new Dictionary <Value, Value>();

            inputMap[Value.Get("Charlie")] = Value.Get(l1);
            inputMap[Value.Get("Jim")]     = Value.Get(l2);
            inputMap[Value.Get("John")]    = Value.Get(l3);
            inputMap[Value.Get("Harry")]   = Value.Get(l4);
            inputMap[Value.Get("Bill")]    = Value.Get(l5);

            // Write values to empty map.
            Record record = client.Operate(args.writePolicy, key,
                                           MapOperation.PutItems(MapPolicy.Default, binName, inputMap)
                                           );

            console.Info("Record: " + record);

            List <Value> end = new List <Value>();

            end.Add(MillisSinceEpoch(new DateTime(2018, 2, 2)));
            end.Add(Value.AsNull);

            // Delete values < end.
            record = client.Operate(args.writePolicy, key,
                                    MapOperation.RemoveByValueRange(binName, null, Value.Get(end), MapReturnType.COUNT)
                                    );

            console.Info("Record: " + record);
        }
        public void OperateMapRemoveRange()
        {
            // Test remove ranges.
            if (!args.ValidateMap())
            {
                return;
            }

            Key key = new Key(args.ns, args.set, "opmkey8");

            client.Delete(null, key);

            Dictionary <Value, Value> inputMap = new Dictionary <Value, Value>();

            inputMap[Value.Get("Charlie")] = Value.Get(55);
            inputMap[Value.Get("Jim")]     = Value.Get(98);
            inputMap[Value.Get("John")]    = Value.Get(76);
            inputMap[Value.Get("Harry")]   = Value.Get(82);
            inputMap[Value.Get("Sally")]   = Value.Get(79);
            inputMap[Value.Get("Lenny")]   = Value.Get(84);
            inputMap[Value.Get("Abe")]     = Value.Get(88);

            Record record = client.Operate(null, key,
                                           MapOperation.PutItems(MapPolicy.Default, binName, inputMap),
                                           MapOperation.RemoveByKeyRange(binName, Value.Get("J"), Value.Get("K"), MapReturnType.COUNT),
                                           MapOperation.RemoveByValueRange(binName, Value.Get(80), Value.Get(85), MapReturnType.COUNT),
                                           MapOperation.RemoveByIndexRange(binName, 0, 2, MapReturnType.COUNT),
                                           MapOperation.RemoveByRankRange(binName, 0, 2, MapReturnType.COUNT)
                                           );

            AssertRecordFound(key, record);

            IList results = record.GetList(binName);
            int   i       = 0;

            long val = (long)results[i++];

            Assert.AreEqual(7, val);

            val = (long)results[i++];
            Assert.AreEqual(2, val);

            val = (long)results[i++];
            Assert.AreEqual(2, val);

            val = (long)results[i++];
            Assert.AreEqual(2, val);

            val = (long)results[i++];
            Assert.AreEqual(1, val);
        }