on 10-30-2015 9:57 AM
Hi,
i'm facing again some troubles dealing this time with the $findAll method...
i've got this code, but is throwing an error
Error: Error in matching clause: Value of $eq must be a String, Number, Boolean or Date
Is there a way to pass the value via variable?? Will it work with the creation of the new instance in the code below?
function setGroupUsers(groupId, listUsers) { | ||
//var con = null; | ||
try { | ||
var instances = user_groupEntity.$findAll({ group_id: { $eq: groupId } }); | ||
user_groupEntity.$discardAll(instances); |
// | con.executeUpdate("DELETE FROM user_group WHERE group_id = ?", groupId); |
users = listUsers.split(","); |
for (var i = 0; i < users.length; i++) { | |
var instance = new user_groupEntity({ user_id: users[i], group_id: groupId }); | |
instance.$save(); |
// con.executeUpdate("INSERT INTO user_group (group_id, user_id) VALUES (?,?)", groupId, users[i]);
} |
//con.commit(); |
} catch(err) { |
throw err; |
} |
} |
Is there a way to pass the value via variable?? Will it work with the creation of the new instance in the code above? If the answer is No, would someone tell me haw to solve this?
Thank you very much in advance.
Best regards,
Luis.
Hello Luis,
variables are of course supported. Can you check which value your parameter "groupId" contains and that it is not null or undefined?
Best Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.