Value to set. Any type. If complex, will be pickled.
time
Optional expiration time, either relative number of seconds
from current time (up to 1 month), or an absolute Unix epoch time.
By default, items never expire, though items may be evicted due to
memory pressure. Float values will be rounded up to the nearest
whole second.
min_compress_len
Ignored option for compatibility.
namespace
a string specifying an optional namespace to use in
the request.
Returns
True if replaced. False on RPC error or cache miss.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egoogle.appengine.api.memcache.replace\u003c/code\u003e function replaces a key's value in memcache only if the key already exists.\u003c/p\u003e\n"],["\u003cp\u003eThis function takes \u003ccode\u003ekey\u003c/code\u003e, \u003ccode\u003evalue\u003c/code\u003e, optional \u003ccode\u003etime\u003c/code\u003e for expiration, and an optional \u003ccode\u003enamespace\u003c/code\u003e as arguments.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evalue\u003c/code\u003e argument can be of any type and will be pickled if complex.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etime\u003c/code\u003e argument can be set to determine expiration, measured either as a relative number of seconds or as an absolute Unix epoch time, and float values will be rounded up to the nearest whole second.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns \u003ccode\u003eTrue\u003c/code\u003e if the replacement is successful, and \u003ccode\u003eFalse\u003c/code\u003e if there's an RPC error or the key is not found.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.memcache.replace\n\n\u003cbr /\u003e\n\nReplaces a key's value, failing if item isn't already in memcache. \n\n google.appengine.api.memcache.replace(\n key, value, time=0, min_compress_len=0, namespace=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]