Creates a new QueryConstraint that if limited to the first specific number
of children.
The limitToFirst() method is used to set a maximum number of children to be
synced for a given callback. If we set a limit of 100, we will initially only
receive up to 100 child_added events. If we have fewer than 100 messages
stored in our Database, a child_added event will fire for each message.
However, if we have over 100 messages, we will only receive a child_added
event for the first 100 ordered messages. As items change, we will receive
child_removed events for each item that drops out of the active list so
that the total number stays at 100.
Parameters
limit: number
The maximum number of nodes to include in this query.
Creates a new
QueryConstraintthat if limited to the first specific number of children.The
limitToFirst()method is used to set a maximum number of children to be synced for a given callback. If we set a limit of 100, we will initially only receive up to 100child_addedevents. If we have fewer than 100 messages stored in our Database, achild_addedevent will fire for each message. However, if we have over 100 messages, we will only receive achild_addedevent for the first 100 ordered messages. As items change, we will receivechild_removedevents for each item that drops out of the active list so that the total number stays at 100.