MongoDB Stitch JavaScript SDK
APACHE-2.0 License
Bot releases are visible (Hide)
This release introduces experimental support for watch
on RemoteMongoCollection
in React Native.
Thanks to changes made recently in React Native 0.62, networking primitives were exposed to make it possible to open an EventSource
-based HTTP stream in React Native in a mobile-friendly way. See this thread and this PR for the work that went into making this possible. Big thanks to the React Native team for making this happen.
Right now, this will only work in the release candidate for React Native 0.62, so we are releasing this feature as an experimental pre-release feature.
If you'd like to try using watch
in your Stitch apps, you can download this version of the SDK by:
npm install --save [email protected]
npm install --save mongodb-stitch-react-native-sdk@next
Note that you must specify the version or the next
tag, otherwise you will get the version of the SDK that does not support watch
in React Native.
Published by jsflax almost 5 years ago
Published by jsflax almost 5 years ago
Published by adamchel over 5 years ago
watch
in RemoteMongoCollection
.
$match
filter.Published by adamchel over 5 years ago
StitchAuthListener
would not get a UserLoggedIn
event on OAuth redirect logins.Published by adamchel over 5 years ago
watch
streams via the Remote MongoDB service, which can save on network usage when working with watch streams.Promise
to never be rejected.Published by dkaminsky over 5 years ago
Buffer
library issue in Angular applicationsPublished by adamchel over 5 years ago
findOne()
, findOneAndUpdate()
, findOneAndReplace()
, and findOneAndDelete()
on RemoteMongoCollection
.logoutUser()
and removeUser()
with an argument in StitchAuth
, to avoid accidentally logging out or deleting the active user when they meant to log out or delete another user.Published by adamchel over 5 years ago
StitchAuthListener
interface, which now provides contextual information about auth events as they occur on the Stitch client. See the docs for StitchAuthListener for more information.isLoggedIn
and lastAuthActivity
field to the StitchUser
interface,
isLoggedIn
is a boolean indicating whether a user is currently logged in (and can thus be switched to).lastAuthActivity
is a Date
indicating the last time the user was logged in, logged out, switched to, or switched from.cross-fetch
as a dependency from mongodb-stitch-core-sdk
, and provided a platform-specific fetch
transport for each platform SDK and a JestFetchTransport
for test modules. This is to solve issues where some applications could not be built with node-fetch
as a dependency. (See #207)Published by adamchel over 5 years ago
watch
method on RemoteMongoCollection
for the browser SDK and Node.js SDK. watch
provides the ability to open a change stream against a collection to get real-time updates about changes that happen on specific documents.
watch
functionalityPublished by adamchel over 5 years ago
BSON
as an export of the browser
, server
and react-native
SDKs. This means you no longer need to separately import BSON to use native BSON types like BSON.ObjectId
. See the README.md for each respective SDK for example usage.Published by adamchel almost 6 years ago
undefined
values before the actual values contained in the header.Published by dkaminsky almost 6 years ago
toArray
to all find operations, with soft deprecation of asArray
Published by adamchel almost 6 years ago
“main”
field in “package.json”), or as an ES6 module (via the “module”
field in "package.json").
0.57.0
)getAppClient
in the Stitch
class that prevented getting initialized app clients without an error being thrown.Published by adamchel about 6 years ago
mongodb-stitch-browser-services-aws
mongodb-stitch-server-services-aws
mongodb-stitch-react-native-services-aws
Published by edaniels over 6 years ago
Note: A previous 3.0.0 version was unpublished from NPM and this version serves as the 3.0.0 release.
StitchClient
can longer be constructed directly. Instead, StitchClientFactory
has been introduced to asynchronously perform any initialization steps needed to create a StitchClient
. StitchClientFactory
has a function called create
that will return a Promise
that will resolve with a StitchClient
after initialization. The resolved client should be used for the lifetime of the application.
// old, 2.x.x usage
import { StitchClient } from 'mongodb-stitch';
const stitchClient = new StitchClient('<app-id>');
stitchClient.login().then(authedId => console.log(authedId));
// app initialization code
// new, 3.x.x usage
import { StitchClientFactory } from 'mongodb-stitch';
const stitchClientPromise = StitchClientFactory.create('<app-id>');
stitchClientPromise.then(stitchClient => stitchClient.login().then(authedId => {
console.log(authedId);
initializeApp(stitchClient);
}));
Since the StitchClient
is only available after the Promise resolves, initialization of an app should be deferred until this time and the client reference should be passed to some initialization component/function.
NOTE: Attempting to construct a StitchClient
without using StitchClientFactory
will result in an error being thrown.
StitchClient
s (with different associated applications).Previously, logging in with a provider while already logging caused no log in to happen which proved to be confusing. These new semantics are in effect:
isAuthenticated()
method to the StitchClient
class. This method should be used to check if any authentication work needs to happen. It returns a boolean declaring whether or not the current client is authenticated.findOne()
method to the MongoDB service class.StitchClientFactory
.Published by edaniels over 6 years ago
StitchClient
can longer be constructed directly. Instead, StitchClientFactory
has been introduced to asynchronously perform any initialization steps needed to create a StitchClient
. StitchClientFactory
has a function called create
that will return a Promise
that will resolve with a StitchClient
after initialization. The resolved client should be used for the lifetime of the application.
// old, 2.x.x usage
import { StitchClient } from 'mongodb-stitch';
const stitchClient = new StitchClient('<app-id>');
stitchClient.login().then(authedId => console.log(authedId));
// app initialization code
// new, 3.x.x usage
import { StitchClientFactory } from 'mongodb-stitch';
const stitchClientPromise = StitchClientFactory.create('<app-id>');
stitchClientPromise.then(stitchClient => stitchClient.login().then(authedId => {
console.log(authedId);
initializeApp(stitchClient);
}));
Since the StitchClient
is only available after the Promise resolves, initialization of an app should be deferred until this time and the client reference should be passed to some initialization component/function.
NOTE: Attempting to construct a StitchClient
without using StitchClientFactory
will result in an error being thrown.
StitchClient
s (with different associated applications).Previously, logging in with a provider while already logging caused no log in to happen which proved to be confusing. These new semantics are in effect:
isAuthenticated()
method to the StitchClient
class. This method should be used to check if any authentication work needs to happen. It returns a boolean declaring whether or not the current client is authenticated.findOne()
method to the MongoDB service class.StitchClientFactory
.