Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public User IncrementVisits(String userId, String name)
  2. {
  3.  
  4. Key recordKey = new Key(NAMESPACE, RECORD_SET, userId);
  5.  
  6. Bin nameBin = new Bin(NAME_BIN, name);
  7. Bin visitBin = new Bin(VISIT_BIN, 1);
  8.  
  9. Record record = asClient.Operate(null, recordKey,
  10. Operation.Add(visitBin),
  11. Operation.Put(nameBin),
  12. Operation.Get(NAME_BIN),
  13. Operation.Get(VISIT_BIN));
  14. return new User(userId, record.GetString(NAME_BIN), record.GetLong(VISIT_BIN));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement