@@ -26,9 +26,9 @@ This readme provides short examples for the following:
26
26
[ Time series] ( #timeseries ) ,<!--
27
27
[ Bulk insert] ( #bulk-insert ) ,
28
28
[ Changes API] ( #changes-api ) ,
29
- [ Streaming] ( #streaming ) ,
30
- [ Revisions] ( #revisions ) ,
29
+ [ Streaming] ( #streaming ) ,
31
30
-->
31
+ [ Revisions] ( #revisions ) ,
32
32
[ Suggestions] ( #suggestions ) ,
33
33
[ Patching] ( #advanced-patching ) ,<!--
34
34
[ Subscriptions] ( #subscriptions ) ,
@@ -1039,30 +1039,31 @@ queryStream.on("error", err => {
1039
1039
> <small>[can stream query results](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Ported/Core/Streaming/QueryStreaming.ts#L76) </small>
1040
1040
> <small>[can stream query results with query statistics](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Ported/Core/Streaming/QueryStreaming.ts#L140) </small>
1041
1041
> <small>[can stream raw query results](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Ported/Core/Streaming/QueryStreaming.ts#L192) </small>
1042
+ -->
1042
1043
1043
1044
## Revisions
1044
1045
1045
1046
NOTE: Please make sure revisions are enabled before trying the below.
1046
1047
1047
- ```javascript
1048
- const session = store.openSession ();
1049
- const user = {
1050
- name: "Marcin",
1051
- age: 30,
1052
- pet: "Cat"
1053
- } ;
1048
+ ``` php
1049
+ $user = new User ();
1050
+ $ user->setName("Marcin");
1051
+ $user->setAge(30);
1052
+ $user->setPet("Cat");
1053
+
1054
+ $session = $store->openSession() ;
1054
1055
1055
1056
// Store a document
1056
- await session. store(user, "users/1");
1057
- await session. saveChanges();
1057
+ $ session-> store($ user, "users/1");
1058
+ $ session-> saveChanges();
1058
1059
1059
1060
// Modify the document to create a new revision
1060
- user.name = "Roman";
1061
- user.age = 40 ;
1062
- await session. saveChanges();
1061
+ $ user->setName( "Roman") ;
1062
+ $ user->setAge(40) ;
1063
+ $ session-> saveChanges();
1063
1064
1064
1065
// Get revisions
1065
- const revisions = await session. advanced. revisions. getFor("users/1");
1066
+ $ revisions = $ session-> advanced()-> revisions()-> getFor("users/1");
1066
1067
1067
1068
// Sample results:
1068
1069
// [ { name: 'Roman',
@@ -1074,16 +1075,18 @@ const revisions = await session.advanced.revisions.getFor("users/1");
1074
1075
// age: 30,
1075
1076
// pet: 'Cat',
1076
1077
// '@metadata': [Object],
1077
- // id: 'users/1' } ]
1078
+ // id: 'users/1' }
1079
+ // ]
1078
1080
```
1081
+ <!--
1079
1082
1080
1083
>##### Related tests:
1081
1084
> <small>[can get revisions](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Documents/ReadmeSamples.ts#L737) </small>
1082
1085
> <small>[canGetRevisionsByDate](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Issues/RavenDB_11770.ts#L21) </small>
1083
1086
> <small>[can handle revisions](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Ported/RevisionsTest.ts#L35) </small>
1084
1087
> <small>[canGetRevisionsByChangeVectors](https://github.com/ravendb/ravendb-nodejs-client/blob/5c14565d0c307d22e134530c8d63b09dfddcfb5b/test/Ported/RevisionsTest.ts#L149) </small>
1085
1088
1086
- -->
1089
+ -->
1087
1090
1088
1091
## Suggestions
1089
1092
0 commit comments