Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Your variable name is ‘User’, however you are referencing ‘user’…unless this is a type on the email?
You currently have:
Var User = {
Id: documentId,
FirstName: this.FirstName,
LastName: this.LastName,
Email: this.Email,
};
replicateTousers(user);
If this is a copy+paste directly from your sql script then the this would be invalid javascript…it would need to be:
var user = {
Id: documentId,
FirstName: this.FirstName,
LastName: this.LastName,
Email: this.Email,
};
replicateTousers(user);
Paul
Can you copy+paste your full sql replication script here?
I think there was a couple of issues, firstly the casing on some of your statements was wrong, and also you have replicateToUserRoles in there twice by the looks of it, it only needs to be inside the for loop, you had one outside the for loop at the end of your script.
Here is a modified script, this *should* work.
var user = {
Id: documentId,
FirstName:this.FirstName,
LastName:this.LastName,
Email:this.Email
};
replicateToUsers(user);
for (var i=0; i<this.UserRoles.length; i++) {
var role = {
UserId: documentId,
UserRole: this.UserRoles[i]
};
replicateToUserRoles(role);