• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

Cette traduction automatique est fournie pour votre commodité.

En cas d'incohérence entre la version anglaise et la version traduite, la version anglaise prévaudra. Veuillez visiter cette page pour plus d'informations.

Créer un problème

AccountStorageMutation

Enregistrez, supprimez ou mettez à jour un document de portée de compte dans NerdStorage. Afin de réaliser cette opération avec succès, l'utilisateur doit disposer des autorisations appropriées.

Usage

import { AccountStorageMutation } from 'nr1'

Exemples

Rédiger un document

AccountStorageMutation.mutate({
accountId: 1,
actionType: AccountStorageMutation.ACTION_TYPE.WRITE_DOCUMENT,
collection: 'myCollection',
documentId: 'myDocumentId',
document: {
name: 'John',
surname: 'Doe',
},
});

Supprimer le document

AccountStorageMutation.mutate({
accountId: 1,
actionType: AccountStorageMutation.ACTION_TYPE.DELETE_DOCUMENT,
collection: 'myCollection',
documentId: 'myDocumentId',
});

Supprimer la collection

AccountStorageMutation.mutate({
accountId: 1,
actionType: AccountStorageMutation.ACTION_TYPE.DELETE_COLLECTION,
collection: 'myCollection',
});

Accessoires

accountId

OBLIGATOIRE
nombre

Identifiant du compte.

actionType

OBLIGATOIRE
énumération

Type d'action à réaliser.

<One of

AccountStorageMutation.ACTION_TYPE.DELETE_COLLECTION, AccountStorageMutation.ACTION_TYPE.DELETE_DOCUMENT, AccountStorageMutation.ACTION_TYPE.WRITE_DOCUMENT,

>

children

OBLIGATOIRE
fonction

Rendre la fonction prop comme des enfants.

function (
mutate: function,

Function to trigger a mutation from your UI.

mutationResult: MutationResult

Results of the mutation.

) => React.ReactNode

collection

OBLIGATOIRE
chaîne

Nom de la collection.

document

objet

Document NerdStorage. Les documents sont limités à une taille de 64 Ko lorsqu'ils sont convertis en chaîne JSON.

documentId

chaîne

Document identifiant pour opérer. En cas d'omission, la collection entière est renvoyée.

Méthodes

AccountStorageMutation.mutate

function (
props: Object

Object containing the mutation options. Any AccountStorageMutation prop is a valid option except children.

) => PromiseQueryResult

Définitions de types

PromiseQueryResult

{
error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your query.

fetchMore: function|null,

If not null, fetchMore allows you to load more results for your query. New data is merged with previous data.

refetch: function,

Refetch the query.

}

MutationResult

{
loading: boolean,

Indicates that the request is in flight.

error: ApolloClient.ApolloError,

Runtime error with graphQLErrors and networkError properties.

data: Object,

Object containing the result of your mutation.

}
Droits d'auteur © 2025 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.