Guest User

Untitled

a guest
Aug 27th, 2018
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. Architecture around mongodb with document and subdocument
  2. {
  3. ApplicationName: "FooApplication",
  4. Settings : [
  5. ConnectionString: "localhost@myserver.com",
  6. UserName: "Admin"
  7. Password: "Password"
  8. ]
  9. }
  10. }
  11. {
  12. ApplicationName: "BarApplication",
  13. Settings : [
  14. ConnectionString: "localhost@myserver.com",
  15. UserName: "Admin",
  16. Password: "Password",
  17. Special: "aaaaaaaaaaaaaa"
  18. ]
  19. }
  20. }
  21.  
  22. public class ApplicationSettings {
  23. public ObjectId Id {get; set;}
  24. public string Name {get; set;}
  25. public Dictionary<string, string> Settings {get; set;}
  26. }
  27.  
  28. var query = Query.EQ("_id", someIdHere);
  29. var update = Update.Set("Settings.ConnectionString", "NewLocalhost@myserver.com")
  30. collection.Update(query, update)
Add Comment
Please, Sign In to add comment