Dear Team,I have read all documentation regarding smart filter. I have read all posts but i am still not able to deploy my code to multichain.
This is my code
function filterstreamitem() {
var item = getfilterstreamitem();
if (item.format != "json")
return "Only JSON items are allowed";
var json = item.data.json;
if ((!json.hasOwnProperty("PersonName")) || (json.PersonName.length < 2))
return "Item requires a PersonName";
if ((!json.hasOwnProperty("PersonCnic")) || (json.PersonCnic.length != 2))
return "Item requires a valid Person Cnic";
}
I have tried everything . i am on windows. My command is multichain-cli chain1 create streamfilter filter1 "{}" 'code' . I have tried one line with single quotes but my code is not being deployed. Each time getting errors. here is my stream data.
"data" : {
"json" : {
"_id" : "5ec77c6308108850902511f2",
"PersonName" : "Testing prototype",
"PersonCnic" : "3310062212345",
"Hash" : "fe540724937edbcbd170d39d7a6ee70e9d429f2d"
}
},
Simple function. Please tell me exact how to run filter