# react-native-meteor-collection2

> Meteor's Collection2 ported for React Native

Latest version **2.0.0** (published 2017-11-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-native-meteor-collection2
pnpm add react-native-meteor-collection2
yarn add react-native-meteor-collection2
bun add react-native-meteor-collection2
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-11-07 |
| First published | 2017-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kelly Copley |
| Maintainers | copleykj |
| Keywords | meteor, collection2, react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-meteor-collection2
- Repository: https://github.com/copleykj/react-native-meteor-collection2
- Homepage: https://github.com/copleykj/react-native-meteor-collection2#readme
- Issues: https://github.com/copleykj/react-native-meteor-collection2/issues
- npm.io page: https://npm.io/package/react-native-meteor-collection2

## Recent versions

- 2.0.0 (latest) — 2017-11-07
- 1.0.0-beta-6 (beta) — 2017-10-26
- 1.0.0-beta-5 — 2017-10-26
- 1.0.0-beta-4 — 2017-10-26
- 1.0.0-beta-3 — 2017-10-26
- 1.0.0-beta-2 — 2017-10-26
- 1.0.0-beta-1 — 2017-10-26
- 1.0.0 — 2017-10-26

## README

# react-native-meteor-collection2 #
This project is a port of the Meteor package `aldeed:collection2-core` to make it's functionality available in React Native.

## Supporting the Project ##
If you appreciate the open source work I do, you can help keep me going with a small donation for my time and effort.

[Bitcoin](https://www.coinbase.com/checkouts/4a52f56a76e565c552b6ecf118461287) / [Patreon](https://www.patreon.com/user?u=4866588) / [Paypal](https://www.paypal.me/copleykj)

## Installation ##

Make sure you have the following packages installed from `npm`.

1. react-native-meteor
2. simpl-schema
3. lodash

Then install this package.

```sh
$ npm install --save react-native-meteor-collection2
```

## Basic Usage ##
We'll assume here that you have a working Meteor app and you have an open ddp connection established using `react-native-meteor`;

```javascript
import Collection from 'react-native-meteor-collection2';
import SomeSchema from '../api/SomeCollection/schema.js'; //We'll assume you share schemas with your meteor app
import { ToastAndroid } from react-native

const SomeCollection = new Collection('someCollection');

SomeCollection.attachSchema(SomeSchema);

try {
    SomeCollection.insert({data:"This is test data"});
} catch (e) {
    ToastAndroid.show(`Insert failed, ${e.reason}`, ToastAndroid.LONG)
}
```

---
_Source: https://npm.io/package/react-native-meteor-collection2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
