/// <summary>
        /// Query on a secondary index with a filter and then apply an additional filter in the 
        /// user defined function.
        /// </summary>
        public override void RunExample(AerospikeClient client, Arguments args)
        {
            if (!args.hasUdf)
            {
                console.Info("Query functions are not supported by the connected Aerospike server.");
                return;
            }
            string indexName = "profileindex";
            string keyPrefix = "profilekey";
            string binName = args.GetBinName("name");

            Register(client, args);
            CreateIndex(client, args, indexName, binName);
            WriteRecords(client, args, keyPrefix, binName);
            RunQuery(client, args, indexName, binName);
            client.DropIndex(args.policy, args.ns, args.set, indexName);
        }
        /// <summary>
        /// Geospatial query examples.
        /// </summary>
        public override void RunExample(AerospikeClient client, Arguments args)
        {
            if (!args.hasGeo)
            {
                console.Info("Geospatial functions are not supported by the connected Aerospike server.");
                return;
            }

            string indexName = "queryindexloc";
            string keyPrefix = "querykeyloc";
            string binName = args.GetBinName("querybinloc");
            int size = 20;

            CreateIndex(client, args, indexName, binName);
            WriteRecords(client, args, keyPrefix, binName, size);
            RunQuery(client, args, indexName, binName);
            RunRadiusQuery(client, args, indexName, binName);
            client.DropIndex(args.policy, args.ns, args.set, indexName);
        }
        /// <summary>
        /// Apply user defined function on records that match the query filter.
        /// </summary>
        public override void RunExample(AerospikeClient client, Arguments args)
        {
            if (!args.hasUdf)
            {
                console.Info("Query functions are not supported by the connected Aerospike server.");
                return;
            }
            string indexName = "qeindex1";
            string keyPrefix = "qekey";
            string binName1 = args.GetBinName("qebin1");
            string binName2 = args.GetBinName("qebin2");
            int size = 10;

            Register(client, args);
            CreateIndex(client, args, indexName, binName1);
            WriteRecords(client, args, keyPrefix, binName1, binName2, size);
            RunQueryExecute(client, args, indexName, binName1, binName2);
            ValidateRecords(client, args, indexName, binName1, binName2, size);
            client.DropIndex(args.policy, args.ns, args.set, indexName);
        }
        private void RunMapKeyExample(AerospikeClient client, Arguments args)
        {
            string indexName = "geo_mapkey";
            string keyPrefix = "mapkey";
            string mapValuePrefix = "mk";
            string binName = "geo_mkey_bin";
            string binName2 = "geo_uniq_bin";
            int size = 1000;

            // create collection index on mapKey
            CreateIndex(client, args, IndexCollectionType.MAPKEYS, indexName, binName);
            WriteMapKeyRecords(client, args, keyPrefix, binName, binName2, mapValuePrefix, size);
            RunQuery(client, args, binName, binName2, IndexCollectionType.MAPKEYS);
            client.DropIndex(args.policy, args.ns, args.set, indexName);
            DeleteRecords(client,args, keyPrefix, size);
        }
        private void RunListExample(AerospikeClient client, Arguments args)
        {
            string indexName = "geo_list";
            string keyPrefix = "list";
            string binName = "geo_list_bin";
            string binName2 = "geo_uniq_bin";
            int size = 1000;

            // create collection index on list
            CreateIndex(client, args, IndexCollectionType.LIST, indexName, binName);
            WriteListRecords(client, args, keyPrefix, binName, binName2, size);
            RunQuery(client, args, binName, binName2, IndexCollectionType.LIST);
            client.DropIndex(args.policy, args.ns, args.set, indexName);
            DeleteRecords(client, args, keyPrefix, size);
        }