# blue.microcosm.links.getManyToMany

> Published by [microcosm.blue](https://lexicon.garden/identity/did:plc:lulmyldiq4sb2ikags5sfb25)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getManyToMany)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getManyToMany/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lulmyldiq4sb2ikags5sfb25/blue.microcosm.links.getManyToMany/examples)

## Definitions

### `blue.microcosm.links.getManyToMany#item`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `linkRecord` | `ref` → `#linkRecord` | Yes | reference to the link record itself |
| `otherSubject` | `string` | Yes | the secondary subject from the link record |

### `blue.microcosm.links.getManyToMany`

**Type**: `query`

Get records that link out to both a primary and secondary subject

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `limit` | `integer` | No | number of results to return |
| `source` | `string` | Yes | collection and path specification for the primary link (e.g., 'app.bsky.feed.like:subject.uri') |
| `linkDid` | `array` | No | filter linking records from specific users |
| `subject` | `string` (uri) | Yes | the primary target being linked to (at-uri, did, or uri) |
| `pathToOther` | `string` | Yes | path to the secondary link in the many-to-many record (e.g., 'otherThing.uri') |
| `otherSubject` | `array` | No | filter secondary links to specific subjects |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `items` | `array` | Yes |  |
| `cursor` | `string` | No |  |

### `blue.microcosm.links.getManyToMany#linkRecord`

**Type**: `object`

A record identifier consisting of a DID, collection, and record key

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | the DID of the linking record's repository |
| `rkey` | `string` (record-key) | Yes |  |
| `collection` | `string` (nsid) | Yes | the collection of the linking record |

## Raw Schema

```json
{
  "id": "blue.microcosm.links.getManyToMany",
  "defs": {
    "item": {
      "type": "object",
      "required": [
        "linkRecord",
        "otherSubject"
      ],
      "properties": {
        "linkRecord": {
          "ref": "#linkRecord",
          "type": "ref",
          "description": "reference to the link record itself"
        },
        "otherSubject": {
          "type": "string",
          "description": "the secondary subject from the link record"
        }
      }
    },
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "items"
          ],
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "ref": "#item",
                "type": "ref"
              }
            },
            "cursor": {
              "type": "string"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "subject",
          "source",
          "pathToOther"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "default": 16,
            "maximum": 100,
            "minimum": 1,
            "description": "number of results to return"
          },
          "source": {
            "type": "string",
            "description": "collection and path specification for the primary link (e.g., 'app.bsky.feed.like:subject.uri')"
          },
          "linkDid": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "did"
            },
            "description": "filter linking records from specific users"
          },
          "subject": {
            "type": "string",
            "format": "uri",
            "description": "the primary target being linked to (at-uri, did, or uri)"
          },
          "pathToOther": {
            "type": "string",
            "description": "path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')"
          },
          "otherSubject": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "filter secondary links to specific subjects"
          }
        }
      },
      "description": "Get records that link out to both a primary and secondary subject"
    },
    "linkRecord": {
      "type": "object",
      "required": [
        "did",
        "collection",
        "rkey"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "the DID of the linking record's repository"
        },
        "rkey": {
          "type": "string",
          "format": "record-key"
        },
        "collection": {
          "type": "string",
          "format": "nsid",
          "description": "the collection of the linking record"
        }
      },
      "description": "A record identifier consisting of a DID, collection, and record key"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
