---
title: "ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:)"
framework: opendirectory
role: symbol
role_heading: Function
path: "opendirectory/odquerycreatewithnode(_:_:_:_:_:_:_:_:_:)"
---

# ODQueryCreateWithNode(_:_:_:_:_:_:_:_:_:)

Creates a query with a node using provided parameters.

## Declaration

```swift
func ODQueryCreateWithNode(_ allocator: CFAllocator!, _ node: ODNodeRef!, _ recordTypeOrList: CFTypeRef!, _ attribute: String!, _ matchType: ODMatchType, _ queryValueOrList: CFTypeRef!, _ returnAttributeOrList: CFTypeRef!, _ maxResults: CFIndex, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>!) -> Unmanaged<ODQueryRef>!
```

## Parameters

- `allocator`: The memory allocator to use. If NULL, the default allocator is used.
- `node`: The node.
- `recordTypeOrList`: The type or types of record to query. Can be a CFString object for a single type or a CFArray object containing CFString objects for multiple types.
- `attribute`: The name of the attribute to query.
- `matchType`: The type of query.
- `queryValueOrList`: The value or values to query in the attribute. Can be a CFString object or a CFData object for a single value, or a CFArray containing CFString and CFData objects for multiple values.
- `returnAttributeOrList`: The attribute or attributes to be returned from the query. Can be a CFString object for a single attribute or a CFArray object containing CFString objects for multiple attributes. Passing NULL is equivalent to passing kODAttributeTypeStandardOnly.
- `maxResults`: The maximum number of values to be returned.
- `error`: An error reference for error details. Can be NULL.

## Return Value

Return Value The created query.

## See Also

### Working with Queries

- [ODQueryCopyResults(_:_:_:)](opendirectory/odquerycopyresults(_:_:_:).md)
- [ODQueryCreateWithNodeType(_:_:_:_:_:_:_:_:_:)](opendirectory/odquerycreatewithnodetype(_:_:_:_:_:_:_:_:_:).md)
- [ODQueryGetTypeID()](opendirectory/odquerygettypeid().md)
- [ODQueryScheduleWithRunLoop(_:_:_:)](opendirectory/odqueryschedulewithrunloop(_:_:_:).md)
- [ODQuerySetCallback(_:_:_:)](opendirectory/odquerysetcallback(_:_:_:).md)
- [ODQuerySetDispatchQueue(_:_:)](opendirectory/odquerysetdispatchqueue(_:_:).md)
- [ODQuerySynchronize(_:)](opendirectory/odquerysynchronize(_:).md)
- [ODQueryUnscheduleFromRunLoop(_:_:_:)](opendirectory/odqueryunschedulefromrunloop(_:_:_:).md)
