---
title: Qid
summary: Class in @bimworks/jssdk.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/jssdk
---

# Qid

[[page:reference/javascript/api|API catalogue]] · `@bimworks/jssdk` · Class

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
class Qid
````

Qid stands for Unique Identifier. It uniquely (and globally) identifies an object in BIM.works. 
It's String representation is a concatenation of a [[page:reference/javascript/bimworks-jssdk/vid-552bcc85|Vid]] and [[page:reference/javascript/bimworks-jssdk/oid-3cdbd99e|Oid]] Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1"
For memory efficiency, it is advised to not pass around the String representation in a JavaScript context, but use these Qid objects.

For efficient aggregation of Qids, you can use [[page:reference/javascript/bimworks-jssdk/qidset-48ad2c6e|QidSet]] and [[page:reference/javascript/bimworks-jssdk/qidmap-26297c7b|QidMap]].

This class does not have a public constructor, use any of the following static methods to get a reference to a Qid:
- `ofVidOid`
- `ofString`
- `of`

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-oid-639763dc69e9|oid]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-vid-e07d8951a29e|vid]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-equals-360728441f14|equals]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-tostring-95e78169cda9|toString]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-of-33c6a03cb2b5|of]] | Method | Get a reference to a Qid by passing "anything". Anything can be either: - A Qid instance, this method will simply return the passed object as-is - A JS Objec… |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-ofstring-4bc49de02603|ofString]] | Method | Get a reference to a Qid object by providing it's String representation. When your end goal is to convert a JS array/iterable of string to a QidSet, consider… |
| [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1#member-ofvidoid-a1f41edf784f|ofVidOid]] | Method | Get a reference to a Qid object by it's vid+oid |

## `oid` {#member-oid-639763dc69e9}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
oid(): number
````



### Returns

The Oid (Object ID) part of this Qid

## `vid` {#member-vid-e07d8951a29e}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
vid(): string
````



### Returns

The Vid (Version UUID) part of this Qid

## `equals` {#member-equals-360728441f14}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
equals(other: Qid): boolean
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `other` | [[page:reference/javascript/bimworks-jssdk/qid-7ed065a1|Qid]] | Must be another Qid instance |

### Returns

Whether the other qid is equal to this qid

## `toString` {#member-tostring-95e78169cda9}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
toString(): string
````



### Returns

This Qid's String representation in the form of [[page:reference/javascript/bimworks-jssdk/vid-552bcc85|Vid]] and [[page:reference/javascript/bimworks-jssdk/oid-3cdbd99e|Oid]] Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1"

## `of` {#member-of-33c6a03cb2b5}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
static of(qid: string | object | Qid): Qid
````

Get a reference to a Qid by passing "anything". Anything can be either:
- A Qid instance, this method will simply return the passed object as-is
- A JS Object, this requires a "vid" and "oid" member to be available on the object
- A String, it is required that the String is constructed [[page:reference/javascript/bimworks-jssdk/vid-552bcc85|Vid]] and [[page:reference/javascript/bimworks-jssdk/oid-3cdbd99e|Oid]] Joined by hyphen: "vid-oid": Example: "227e071d-4909-4b5c-8d48-46f44d027c46-1"

Of neither of the above was provided an exception is thrown

### Parameters

| Name | Type | Description |
|---|---|---|
| `qid` | `string \| object \| Qid` | A Qid, String or Object |

### Returns

A Qid

## `ofString` {#member-ofstring-4bc49de02603}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
static ofString(qid: string): Qid
````

Get a reference to a Qid object by providing it's String representation.
When your end goal is to convert a JS array/iterable of string to a [[page:reference/javascript/bimworks-jssdk/qidset-48ad2c6e|QidSet]], consider using `QidSet.ofIterable` which is more performant

### Parameters

| Name | Type | Description |
|---|---|---|
| `qid` | `string` | The String representation of a Qid |

## `ofVidOid` {#member-ofvidoid-a1f41edf784f}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
static ofVidOid(vid: string, oid: number): Qid
````

Get a reference to a Qid object by it's vid+oid

### Parameters

| Name | Type | Description |
|---|---|---|
| `vid` | `string` | A Vid (Version UUID) |
| `oid` | `number` | An Oid (Object ID); |

### Returns

A Qid
