mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-06 10:57:51 +00:00
Merge pull request #1030 from travisturner/tutorial-field-fixes
apply comments in #1022
This commit is contained in:
commit
767c52dd16
1 changed files with 2 additions and 18 deletions
|
|
@ -236,24 +236,6 @@ curl localhost:10101/index/patients/frame/measurements \
|
|||
```
|
||||
|
||||
In addition to storing rows of bits, a frame can also contain fields that store integer values. The next step creates three fields (`age`, `weight`, `tcells`) in the `measurements` frame.
|
||||
```
|
||||
curl localhost:10101/index/patients/frame/measurements/field/age \
|
||||
-X POST \
|
||||
-d '{"type": "int", "min": 0, "max": 120}'
|
||||
|
||||
curl localhost:10101/index/patients/frame/measurements/field/weight \
|
||||
-X POST \
|
||||
-d '{"type": "int", "min": 0, "max": 500}'
|
||||
|
||||
curl localhost:10101/index/patients/frame/measurements/field/tcells \
|
||||
-X POST \
|
||||
-d '{"type": "int", "min": 0, "max": 2000}'
|
||||
```
|
||||
|
||||
<div class="note">
|
||||
It's possible to create a frame with multiple fields in a single step. To do that, you just include a "fields" attribute to the frame options like the example below:
|
||||
</div>
|
||||
|
||||
```
|
||||
curl localhost:10101/index/patients/frame/measurements \
|
||||
-X POST \
|
||||
|
|
@ -267,6 +249,8 @@ curl localhost:10101/index/patients/frame/measurements \
|
|||
}}'
|
||||
```
|
||||
|
||||
If you need to, you can add fields to an existing frame by posting to the [Create Field endpoint](../api-reference/#create-field).
|
||||
|
||||
Next, let's populate our fields with data. There are two ways to get data into fields: use the `SetFieldValue()` PQL function to set fields individually, or use the `pilosa import` command to import many values at once. First, let's set some field data using PQL.
|
||||
|
||||
This query sets the age, weight, and t-cell count for the patient with ID `1` in our system:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue