-
Notifications
You must be signed in to change notification settings - Fork 19
Update queries
yojimbo87 edited this page Apr 26, 2013
·
4 revisions
SQL | Fluent |
---|---|
``` UPDATE TestVertexClass SET foo = 'new string value', bar = 54321 WHERE @rid = #8:0 ``` |
```csharp
database
.Update.Class("TestVertexClass")
.Set("foo", "new string value")
.Set("bar", 54321)
.Where("@rid").Equals(new ORID(8, 0))
.Run();
```
or
```csharp
ODocument document = new ODocument();
document.SetField("foo", "new string value");
document.SetField("bar", 54321);
database .Update.Class() .Set(document) .Where("@rid").Equals(new ORID(8, 0)) .Run();
or ODocument document = new ODocument();
document.OClassName = "TestVertexClass";
document.SetField("foo", "new string value");
document.SetField("bar", 54321);
database
.Update(document)
.Where("@rid").Equals(new ORID(8, 0))
.Run();
|
``` UPDATE #8:0 SET foo = 'foo string value', bar = 12345 ``` |
```csharp
ODocument document = new ODocument();
document.SetField("foo", "foo string value");
document.SetField("bar", 12345);
database .Update.Record(new ORID(8, 0)) .Set(document ) .Run();
or ODocument document = new ODocument();
document.ORID = new ORID(8, 0);
document.SetField("foo", "foo string value");
document.SetField("bar", 12345);
database
.Update(document)
.Run();
|
``` UPDATE #8:0 ADD FooCollection = 'foo 3' ``` | ```csharp database .Update.Record(new ORID(8, 0)) .Add("FooCollection", "foo 3") .Run(); ``` |
``` UPDATE #8:0 REMOVE Bar ``` | ```csharp database .Update.Record(new ORID(8, 0)) .Remove("Bar") .Run(); ``` |
``` UPDATE #8:0 REMOVE FooCollection = 'foo 1' ``` | ```csharp database .Update.Record(new ORID(8, 0)) .Remove("FooCollection", "foo 1") .Run(); ``` |