# How to store a list of list of live queries

**URL:** <https://community.parseplatform.org/t/how-to-store-a-list-of-list-of-live-queries/1580>\
**Category:** ParseSwift SDK\
**Tags:** live-query\
**Created:** [April 15, 2021, 1:31pm UTC](https://community.parseplatform.org/t/how-to-store-a-list-of-list-of-live-queries/1580 "2021-04-15T13:31:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierlux](https://community.parseplatform.org/user_avatar/community.parseplatform.org/pierlux/32/532_2.png) [@pierlux](https://community.parseplatform.org/u/pierlux)\
**Post date:** [April 15, 2021, 1:31pm UTC](https://community.parseplatform.org/t/how-to-store-a-list-of-list-of-live-queries/1580/1 "2021-04-15T13:31:44Z")

</div>

Sorry if it’s more of a Swift question but I can’t figure out how to google for this question 😁

I created a few live query objects on different classes and I’d like to create a list of all of them (so that I can unsubscribe later). How would that work in Swift?

```auto
let liveQuery = Library.query("updatedAt" > since)
let liveQueries: ??? = []
liveQueries.append(liveQuery)

```

Similarly, I’ve been unable to create an array of ParseObjects as it is a protocol, do I have to create by own base object if I want to store them in an array?

---

<div class="post-metadata">

**Author:** ![cbaker6](https://community.parseplatform.org/user_avatar/community.parseplatform.org/cbaker6/32/114_2.png) [@cbaker6](https://community.parseplatform.org/u/cbaker6)\
**Post date:** [April 15, 2021, 2:24pm UTC](https://community.parseplatform.org/t/how-to-store-a-list-of-list-of-live-queries/1580/2 "2021-04-15T14:24:38Z")

</div>

> [@pierlux](#):
>
> Similarly, I’ve been unable to create an array of ParseObjects as it is a protocol, do I have to create by own base object if I want to store them in an array?

For your object, create an empty protocol and make all of your objects you want in the array conform to your new protocol:

```swift

protocol LibraryType { }

struct Library: ParseObject, LibraryType {
...
}

struct Book: ParseObject, LibraryType {
...
}

let array: [LibraryType] = [library, book]

```

You can’t make an array of ParseObject because it requires `self`. You can see I did something similar to this in the SDK with `ParseType`:

> <https://github.com/parse-community/Parse-Swift/blob/be5de49a6c7d7e1e700bba43e279e6e9f54cd2a5/Sources/ParseSwift/Protocols/ParseType.swift#L11>

> <https://github.com/parse-community/Parse-Swift/blob/db0fdea9daf517c899e8bd538def215df8c67a60/Sources/ParseSwift/Objects/ParseObject.swift#L659-L662>

Technically you can automatically make an array using `ParseType`, but I don’t recommend depending on that as `ParseType` isn’t documented because it’s not meant for developers to use. If we change `ParseType` to something else, it could break your code. So you should create your own protocol.

For subscriptions you will most likely need to do something similar to the testcase below (there are many in the file if you need more):

> <https://github.com/parse-community/Parse-Swift/blob/70820d6294e81dcfce5f93a27e1b150e56002cd9/Tests/ParseSwiftTests/ParseQueryCombineTests.swift#L74-L116>

---

<div class="post-metadata">

**Author:** ![pierlux](https://community.parseplatform.org/user_avatar/community.parseplatform.org/pierlux/32/532_2.png) [@pierlux](https://community.parseplatform.org/u/pierlux)\
**Post date:** [April 15, 2021, 4:42pm UTC](https://community.parseplatform.org/t/how-to-store-a-list-of-list-of-live-queries/1580/3 "2021-04-15T16:42:10Z")

</div>

OK Thanks I’ll digest this all.
