-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
uggh, when I ran this code:
<html>
<body>
<script src="http://rawgit.com/amark/gun/master/gun.js"></script>
<script>
localStorage.clear();
var gun = Gun();
// define the snake team!
var snakes = gun.get('team/snakes').put({team: "snakes"});
// add members to the snake team in one go!
snakes.path('members')
.set({name: "alice"}).back
.set({name: "bob"}).back
snakes.val(function(theTeam){
// now add the snake team as a field to each of the members.
snakes.path('members').map().path('team').put(theTeam);
});
</script>
</body>
</html>
it only added theTeam to the first item it mapped over, not both items it mapped over.
Does this happen constantly?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels