Skip to content

Commit 6d6cd43

Browse files
committed
docs
1 parent d99614f commit 6d6cd43

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Slice Array
2+
3+
The slice array operator takes an array as input and returns a subarray. Like the `jq` equivalent, `.[10:15]` will return an array of length 5, starting from index 10 inclusive, up to index 15 exclusive. Negative numbers count backwards from the end of the array.
4+
5+
You may leave out the first or second number, which will will refer to the start or end of the array respectively.

pkg/yqlib/doc/operators/slice-array.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Slice Array
2+
3+
The slice array operator takes an array as input and returns a subarray. Like the `jq` equivalent, `.[10:15]` will return an array of length 5, starting from index 10 inclusive, up to index 15 exclusive. Negative numbers count backwards from the end of the array.
4+
5+
You may leave out the first or second number, which will will refer to the start or end of the array respectively.
16

27
## Slicing arrays
38
Given a sample.yml file of:

release_notes.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
4.29.1:
22
- Fixed Square brackets removing update #1342
3+
- Added slice array operator (.[10:15]) #44
34
- XML decoder/encoder now parses directives and proc instructions (#1344). Please use the new skip flags [documented here](https://mikefarah.gitbook.io/yq/usage/xml) to ignore them.
5+
- XML users note that the default attribute prefix will change to `+@` in the 4.30 release to avoid naming conflicts!
6+
- Improved comment handling of decoders (breaking change for yqlib users sorry)
7+
- Fixed load operator bug when loading yaml file with multiple documents
48
- Bumped Go compiler version
9+
- Bumped dependencies
510

611
4.28.2:
712
- Fixed Github Actions issues (thanks @mattphelps-8451)

0 commit comments

Comments
 (0)